Skip to content

Commit 43f1fbc

Browse files
committed
MAGETWO-44274: SQL error appears if Save & Duplicate product with images
Fix duplicate images
1 parent 59cb545 commit 43f1fbc

File tree

1 file changed

+2
-0
lines changed
  • app/code/Magento/Catalog/Model/ResourceModel/Product/Attribute/Backend

1 file changed

+2
-0
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Attribute/Backend/Media.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,9 @@ public function duplicate($attributeId, $newFiles, $originalProductId, $newProdu
345345

346346
foreach ($this->getConnection()->fetchAll($select) as $row) {
347347
$row['value_id'] = $valueIdMap[$row['value_id']];
348+
unset($row['record_id']);
348349
$this->insertGalleryValueInStore($row);
350+
$this->bindValueToEntity($row['value_id'], $newProductId);
349351
}
350352

351353
return $this;

0 commit comments

Comments
 (0)