File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,24 @@ class Helper
121
121
*/
122
122
private $ categoryLinkFactory ;
123
123
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
+
124
142
/**
125
143
* Constructor
126
144
*
@@ -203,6 +221,12 @@ public function initializeFromData(Product $product, array $productData)
203
221
$ productData ['product_has_weight ' ] = 0 ;
204
222
}
205
223
224
+ foreach ($ productData as $ key => $ value ) {
225
+ if (in_array ($ key , $ this ->productDataKeys ) && $ value === '' ) {
226
+ $ productData [$ key ] = null ;
227
+ }
228
+ }
229
+
206
230
foreach (['category_ids ' , 'website_ids ' ] as $ field ) {
207
231
if (!isset ($ productData [$ field ])) {
208
232
$ productData [$ field ] = [];
You can’t perform that action at this time.
0 commit comments