File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
app/code/Magento/Customer/Controller/Adminhtml/Index Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 1313use Magento \Customer \Model \Metadata \Form ;
1414use Magento \Framework \Exception \LocalizedException ;
1515
16+ /**
17+ * Class Save
18+ * @package Magento\Customer\Controller\Adminhtml\Index
19+ *
20+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
21+ */
1622class Save extends \Magento \Customer \Controller \Adminhtml \Index
1723{
1824 /**
@@ -268,6 +274,15 @@ public function execute()
268274 $ this ->_addSessionErrorMessages ($ messages );
269275 $ this ->_getSession ()->setCustomerFormData ($ originalRequestData );
270276 $ returnToEdit = true ;
277+ } catch (\Magento \Framework \Exception \AbstractAggregateException $ exception ) {
278+ $ errors = $ exception ->getErrors ();
279+ $ messages = [];
280+ foreach ($ errors as $ error ) {
281+ $ messages [] = $ error ->getMessage ();
282+ }
283+ $ this ->_addSessionErrorMessages ($ messages );
284+ $ this ->_getSession ()->setCustomerFormData ($ originalRequestData );
285+ $ returnToEdit = true ;
271286 } catch (LocalizedException $ exception ) {
272287 $ this ->_addSessionErrorMessages ($ exception ->getMessage ());
273288 $ this ->_getSession ()->setCustomerFormData ($ originalRequestData );
You can’t perform that action at this time.
0 commit comments