File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
app/code/Magento/ConfigurableProduct
Block/Adminhtml/Product/Steps Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ class Bulk extends \Magento\Ui\Block\Component\StepsWizard\StepAbstract
20
20
/**
21
21
* @param \Magento\Framework\View\Element\Template\Context $context
22
22
* @param \Magento\Catalog\Helper\Image $image
23
+ * @param \Magento\ConfigurableProduct\Model\Product\VariationMediaAttributes $variationMediaAttributes
23
24
*/
24
25
public function __construct (
25
26
\Magento \Framework \View \Element \Template \Context $ context ,
Original file line number Diff line number Diff line change @@ -217,11 +217,11 @@ public function duplicateImagesForVariations($productsData)
217
217
$ variationId = $ image ['variation_id ' ];
218
218
$ newFile = $ this ->media ->duplicateImageFromTmp ($ file );
219
219
$ productsData [$ variationId ]['media_gallery ' ]['images ' ][$ imageId ]['file ' ] = $ newFile ;
220
- foreach ($ this ->variationMediaAttributes ->getMediaAttributes () as $ imageType => $ attribute ) {
221
- if (isset ($ productsData [$ variationId ][$ imageType ])
222
- && $ productsData [$ variationId ][$ imageType ] == $ file
220
+ foreach ($ this ->variationMediaAttributes ->getMediaAttributes () as $ attribute ) {
221
+ if (isset ($ productsData [$ variationId ][$ attribute -> getAttributeCode () ])
222
+ && $ productsData [$ variationId ][$ attribute -> getAttributeCode () ] == $ file
223
223
) {
224
- $ productsData [$ variationId ][$ imageType ] = $ newFile ;
224
+ $ productsData [$ variationId ][$ attribute -> getAttributeCode () ] = $ newFile ;
225
225
}
226
226
}
227
227
}
You can’t perform that action at this time.
0 commit comments