Skip to content

[Backport 2.3-develop] Handle multiple errors in customer address validation when shown in adminhtml customer edit page #12937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

adrian-martinez-interactiv4
Copy link
Contributor

Description

When multiple validation errors are found trying to save a customer address, errors are not properly shown in adminhtml customer edit page. Related with PR #12922

Fixed Issues (if relevant)

None AFAIK

Manual testing scenarios

  1. Simulate several validation errors when trying to save a customer address from admin, for example, adding temporarily this code almost at the end of \Magento\Customer\Model\Address\AbstractAddress::validate method:
    /**
     * Validate address attribute values
     *
     * @return bool|array
     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
     * @SuppressWarnings(PHPMD.NPathComplexity)
     */
    public function validate()
    {
        (...)

        $errors = [];
        $errors[] = __('Error 1');
        $errors[] = __('Error 2');

        if (empty($errors) || $this->getShouldIgnoreValidation()) {
            return true;
        }
        return $errors;
    }

Expected result

captura de pantalla 2017-12-29 a las 14 40 58

Actual result

captura de pantalla 2017-12-29 a las 14 40 10

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@dmanners dmanners self-assigned this Jan 10, 2018
@dmanners dmanners added this to the January 2018 milestone Jan 10, 2018
@magento-team magento-team merged commit 19fbeee into magento:2.3-develop Jan 10, 2018
magento-team pushed a commit that referenced this pull request Jan 10, 2018
…mer address validation when shown in adminhtml customer edit page #12937
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants