File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
app/code/Magento/Customer/Controller/Adminhtml/Index Expand file tree Collapse file tree 1 file changed +12
-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
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
18
+ */
16
19
class Save extends \Magento \Customer \Controller \Adminhtml \Index
17
20
{
18
21
/**
@@ -268,6 +271,15 @@ public function execute()
268
271
$ this ->_addSessionErrorMessages ($ messages );
269
272
$ this ->_getSession ()->setCustomerFormData ($ originalRequestData );
270
273
$ returnToEdit = true ;
274
+ } catch (\Magento \Framework \Exception \AbstractAggregateException $ exception ) {
275
+ $ errors = $ exception ->getErrors ();
276
+ $ messages = [];
277
+ foreach ($ errors as $ error ) {
278
+ $ messages [] = $ error ->getMessage ();
279
+ }
280
+ $ this ->_addSessionErrorMessages ($ messages );
281
+ $ this ->_getSession ()->setCustomerFormData ($ originalRequestData );
282
+ $ returnToEdit = true ;
271
283
} catch (LocalizedException $ exception ) {
272
284
$ this ->_addSessionErrorMessages ($ exception ->getMessage ());
273
285
$ this ->_getSession ()->setCustomerFormData ($ originalRequestData );
You can’t perform that action at this time.
0 commit comments