Skip to content

Commit 3ecadf2

Browse files
MAGETWO-94267: [2.3] Admin logs don't detail quantity changes
1 parent 716dca6 commit 3ecadf2

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ public function execute()
102102
$this->productBuilder->build($this->getRequest())
103103
);
104104
$this->productTypeManager->processProduct($product);
105-
106105
if (isset($data['product'][$product->getIdFieldName()])) {
107106
throw new \Magento\Framework\Exception\LocalizedException(
108107
__('The product was unable to be saved. Please try again.')
109108
);
110109
}
111110

112111
$originalSku = $product->getSku();
112+
$canSaveCustomOptions = $product->getCanSaveCustomOptions();
113113
$product->save();
114114
$this->handleImageRemoveError($data, $product->getId());
115115
$this->getCategoryLinkManagement()->assignProductToCategories(
@@ -119,9 +119,9 @@ public function execute()
119119
$productId = $product->getEntityId();
120120
$productAttributeSetId = $product->getAttributeSetId();
121121
$productTypeId = $product->getTypeId();
122-
123-
$this->copyToStores($data, $productId);
124-
122+
$extendedData = $data;
123+
$extendedData['can_save_custom_options'] = $canSaveCustomOptions;
124+
$this->copyToStores($extendedData, $productId);
125125
$this->messageManager->addSuccessMessage(__('You saved the product.'));
126126
$this->getDataPersistor()->clear('catalog_product');
127127
if ($product->getSku() != $originalSku) {
@@ -143,6 +143,7 @@ public function execute()
143143
);
144144

145145
if ($redirectBack === 'duplicate') {
146+
$product->unsetData('quantity_and_stock_status');
146147
$newProduct = $this->productCopier->copy($product);
147148
$this->messageManager->addSuccessMessage(__('You duplicated the product.'));
148149
}
@@ -239,6 +240,7 @@ protected function copyToStores($data, $productId)
239240
->setStoreId($copyFrom)
240241
->load($productId)
241242
->setStoreId($copyTo)
243+
->setCanSaveCustomOptions($data['can_save_custom_options'])
242244
->setCopyFromView(true)
243245
->save();
244246
}

app/code/Magento/CatalogInventory/Observer/ProcessInventoryDataObserver.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ private function processStockData(Product $product)
7474
$this->setStockDataToProduct($product, $stockItem, $quantityAndStockStatus);
7575
}
7676
}
77-
$product->unsetData('quantity_and_stock_status');
7877
}
7978

8079
/**

app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
<features value="Wishlist"/>
1313
<title value="Customer should be able to add products to wishlist from different stores"/>
1414
<description value="All products added to wishlist should be visible on any store. Even if product visibility was set to 'Not Visible Individually' for this store"/>
15+
<!-- Skipped because of MAGETWO-93980 -->
16+
<group value="skip"/>
1517
<group value="wishlist"/>
1618
</annotations>
1719
<before>

0 commit comments

Comments
 (0)