File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -130,12 +130,12 @@ public function execute()
130
130
$ shipment ->setCustomerNote ($ data ['comment_text ' ]);
131
131
$ shipment ->setCustomerNoteNotify (isset ($ data ['comment_customer_notify ' ]));
132
132
}
133
- $ errorMessages = $ this ->getShipmentValidator ()
134
- ->validate ($ shipment , [QuantityValidator::class])
135
- -> getMessages ();
136
- if (! empty ( $ errorMessages )) {
133
+ $ validationResult = $ this ->getShipmentValidator ()
134
+ ->validate ($ shipment , [QuantityValidator::class]);
135
+
136
+ if ($ validationResult -> hasMessages ( )) {
137
137
$ this ->messageManager ->addError (
138
- __ ("Shipment Document Validation Error(s): \n" . implode ("\n" , $ errorMessages ))
138
+ __ ("Shipment Document Validation Error(s): \n" . implode ("\n" , $ validationResult -> getMessages () ))
139
139
);
140
140
$ this ->_redirect ('*/*/new ' , ['order_id ' => $ this ->getRequest ()->getParam ('order_id ' )]);
141
141
return ;
You can’t perform that action at this time.
0 commit comments