Skip to content

Commit 25df10d

Browse files
committed
ACP2E-741: Scheduled update settings not saved if originally added by running update
- fix
1 parent 5d9fe40 commit 25df10d

File tree

1 file changed

+24
-0
lines changed
  • app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization

1 file changed

+24
-0
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,24 @@ class Helper
121121
*/
122122
private $categoryLinkFactory;
123123

124+
/**
125+
* @var array
126+
*/
127+
private $productDataKeys = [
128+
'weight',
129+
'special_price',
130+
'cost',
131+
'country_of_manufacture',
132+
'description',
133+
'short_description',
134+
'meta_description',
135+
'meta_keyword',
136+
'meta_title',
137+
'page_layout',
138+
'custom_design',
139+
'gift_wrapping_price'
140+
];
141+
124142
/**
125143
* Constructor
126144
*
@@ -203,6 +221,12 @@ public function initializeFromData(Product $product, array $productData)
203221
$productData['product_has_weight'] = 0;
204222
}
205223

224+
foreach ($productData as $key => $value) {
225+
if (in_array($key, $this->productDataKeys) && $value === '') {
226+
$productData[$key] = null;
227+
}
228+
}
229+
206230
foreach (['category_ids', 'website_ids'] as $field) {
207231
if (!isset($productData[$field])) {
208232
$productData[$field] = [];

0 commit comments

Comments
 (0)