File tree Expand file tree Collapse file tree 3 files changed +5
-1
lines changed
Controller/Adminhtml/Product Expand file tree Collapse file tree 3 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,9 @@ public function execute()
139139 }
140140
141141 $ originalSku = $ product ->getSku ();
142+ if ($ originalSku == 0 ){
143+ throw new \Magento \Framework \Exception \LocalizedException (__ ("SKU cannot be zero. " ));
144+ }
142145 $ canSaveCustomOptions = $ product ->getCanSaveCustomOptions ();
143146 $ product ->save ();
144147 $ this ->handleImageRemoveError ($ data , $ product ->getId ());
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ public function save(\Magento\Catalog\Api\Data\ProductLinkInterface $entity)
139139 . 'Please ensure the parent product SKU is provided and try again. '
140140 ));
141141 }
142- if (! $ entity ->getLinkedProductSku ()) {
142+ if ($ entity ->getLinkedProductSku () === null || $ entity -> getLinkedProductSku () === '' ) {
143143 throw new CouldNotSaveException (__ ('The linked product SKU is invalid. Verify the data and try again. ' ));
144144 }
145145 $ linkedProduct = $ this ->productRepository ->get ($ entity ->getLinkedProductSku ());
Original file line number Diff line number Diff line change @@ -868,3 +868,4 @@ Details,Details
868868"Add To Compare","Add To Compare"
869869"Learn more","Learn more"
870870"Recently Viewed","Recently Viewed"
871+ "SKU cannot be zero.","SKU cannot be zero."
You can’t perform that action at this time.
0 commit comments