Skip to content

Conversation

@m-michalis
Copy link
Contributor

This is the 3rd PR based on @addison74's #5026 (comment)

Parts:

Description

Fixes a long-standing issue in the product duplication workflow where product image files were physically copied but not associated with the duplicated product.

This change decouples the image copy logic in


and executes it as a dedicated step after the product has been successfully duplicated:
$this->getResource()
->setSkipImagesOnDuplicate($newProduct->getSkipImagesOnDuplicate())
->duplicate($this->getId(), $newProduct->getId());

  • Image files are correctly assigned to duplicated products
  • No orphaned image files are created during product duplication
  • Product duplication behavior is more predictable and easier to maintain

… to a separate step after the product has been duplicated (after getResource()->duplicate(oldid,newid))

- fixed logic for the duplicated product to actually use the copied images (years old bug)
@github-actions github-actions bot added the Component: Catalog Relates to Mage_Catalog label Jan 10, 2026
@sonarqubecloud
Copy link

@addison74
Copy link
Contributor

This PR is well elaborated and implemented. Thank you @m-michalis for your contribution.

I kindly ask those who have some time available to test and get it ready for 2.17.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Catalog Relates to Mage_Catalog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants