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
2020 /**
2121 * @param \Magento\Framework\View\Element\Template\Context $context
2222 * @param \Magento\Catalog\Helper\Image $image
23+ * @param \Magento\ConfigurableProduct\Model\Product\VariationMediaAttributes $variationMediaAttributes
2324 */
2425 public function __construct (
2526 \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)
217217 $ variationId = $ image ['variation_id ' ];
218218 $ newFile = $ this ->media ->duplicateImageFromTmp ($ file );
219219 $ 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
223223 ) {
224- $ productsData [$ variationId ][$ imageType ] = $ newFile ;
224+ $ productsData [$ variationId ][$ attribute -> getAttributeCode () ] = $ newFile ;
225225 }
226226 }
227227 }
You can’t perform that action at this time.
0 commit comments