File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed
app/code/Magento/Catalog/Controller/Adminhtml/Product Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,10 @@ private function handleImageRemoveError($postData, $productId)
216
216
/**
217
217
* Do copying data to stores
218
218
*
219
+ * In case when 'copy_from' didnt specified we suppose, that data should be taken
220
+ * from default values (from admin store). For this we have fallback, and there is no need
221
+ * to copy data between 0 store and some speficic store
222
+ *
219
223
* @param array $data
220
224
* @param int $productId
221
225
* @return void
@@ -227,15 +231,17 @@ protected function copyToStores($data, $productId)
227
231
if (isset ($ data ['product ' ]['website_ids ' ][$ websiteId ])
228
232
&& (bool )$ data ['product ' ]['website_ids ' ][$ websiteId ]) {
229
233
foreach ($ group as $ store ) {
230
- $ copyFrom = (isset ($ store ['copy_from ' ])) ? $ store ['copy_from ' ] : 0 ;
231
- $ copyTo = (isset ($ store ['copy_to ' ])) ? $ store ['copy_to ' ] : 0 ;
232
- if ($ copyTo ) {
233
- $ this ->_objectManager ->create (\Magento \Catalog \Model \Product::class)
234
- ->setStoreId ($ copyFrom )
235
- ->load ($ productId )
236
- ->setStoreId ($ copyTo )
237
- ->setCopyFromView (true )
238
- ->save ();
234
+ if (isset ($ store ['copy_from ' ])) {
235
+ $ copyFrom = $ store ['copy_from ' ];
236
+ $ copyTo = (isset ($ store ['copy_to ' ])) ? $ store ['copy_to ' ] : 0 ;
237
+ if ($ copyTo ) {
238
+ $ this ->_objectManager ->create (\Magento \Catalog \Model \Product::class)
239
+ ->setStoreId ($ copyFrom )
240
+ ->load ($ productId )
241
+ ->setStoreId ($ copyTo )
242
+ ->setCopyFromView (true )
243
+ ->save ();
244
+ }
239
245
}
240
246
}
241
247
}
You can’t perform that action at this time.
0 commit comments