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
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 ] = [];
You can’t perform that action at this time.
0 commit comments