Skip to content

Conversation

adrian-martinez-interactiv4
Copy link
Contributor

@adrian-martinez-interactiv4 adrian-martinez-interactiv4 commented Dec 29, 2017

Description

When multiple validation errors are found trying to save a customer address, errors are not properly shown in adminhtml customer edit page

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)

@adrian-martinez-interactiv4 adrian-martinez-interactiv4 force-pushed the FR22#ADMINHTML-CUSTOMER-SAVE-MULTIPLE-ERROR-MESSAGES branch from a32ed43 to 6ebb7d9 Compare December 29, 2017 17:18
@fooman fooman self-assigned this Dec 30, 2017
@fooman fooman added this to the December 2017 milestone Dec 30, 2017
@@ -13,6 +13,12 @@
use Magento\Customer\Model\Metadata\Form;
use Magento\Framework\Exception\LocalizedException;

/**
* Class Save
* @package Magento\Customer\Controller\Adminhtml\Index
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magento doesn't really use the @Package annotation elsewhere, would you mind removing that one.

@okorshenko okorshenko self-assigned this Jan 8, 2018
@okorshenko okorshenko modified the milestones: December 2017, January 2018 Jan 8, 2018
magento-team pushed a commit that referenced this pull request Jan 8, 2018
@magento-team magento-team merged commit 141e293 into magento:2.2-develop Jan 8, 2018
@fooman fooman removed their assignment Jul 2, 2025
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.

5 participants