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 13
13
use Magento \Customer \Model \Metadata \Form ;
14
14
use Magento \Framework \Exception \LocalizedException ;
15
15
16
+ /**
17
+ * Class Save
18
+ * @package Magento\Customer\Controller\Adminhtml\Index
19
+ *
20
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
21
+ */
16
22
class Save extends \Magento \Customer \Controller \Adminhtml \Index
17
23
{
18
24
/**
@@ -268,6 +274,15 @@ public function execute()
268
274
$ this ->_addSessionErrorMessages ($ messages );
269
275
$ this ->_getSession ()->setCustomerFormData ($ originalRequestData );
270
276
$ 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 ;
271
286
} catch (LocalizedException $ exception ) {
272
287
$ this ->_addSessionErrorMessages ($ exception ->getMessage ());
273
288
$ this ->_getSession ()->setCustomerFormData ($ originalRequestData );
You can’t perform that action at this time.
0 commit comments