File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -304,6 +304,12 @@ protected function setProductLinks(Product $product)
304
304
$ readonlyRelatedProducts = false ;
305
305
$ readonlyUpSellProducts = false ;
306
306
foreach ($ linkTypes as $ linkType => $ readonly ) {
307
+ if ($ linkType === 'related ' && $ readonly ) {
308
+ $ readonlyRelatedProducts = true ;
309
+ }
310
+ if ($ linkType === 'upsell ' && $ readonly ) {
311
+ $ readonlyUpSellProducts = true ;
312
+ }
307
313
if (isset ($ links [$ linkType ]) && !$ readonly ) {
308
314
foreach ((array ) $ links [$ linkType ] as $ linkData ) {
309
315
if (empty ($ linkData ['id ' ])) {
@@ -319,15 +325,9 @@ protected function setProductLinks(Product $product)
319
325
$ productLinks [] = $ link ;
320
326
}
321
327
}
322
- if ($ linkType === 'related ' && $ readonly ) {
323
- $ readonlyRelatedProducts = true ;
324
- }
325
- if ($ linkType === 'upsell ' && $ readonly ) {
326
- $ readonlyUpSellProducts = true ;
327
- }
328
328
}
329
329
if ($ readonlyRelatedProducts && $ readonlyUpSellProducts && empty ($ productLinks )) {
330
- $ productLinks = $ currentProductLinks ;
330
+ return $ product -> setProductLinks ( $ currentProductLinks) ;
331
331
}
332
332
333
333
return $ product ->setProductLinks ($ productLinks );
You can’t perform that action at this time.
0 commit comments