Skip to content

Prevent endless loop when duplicating product #25875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

JeroenVanLeusden
Copy link
Member

@JeroenVanLeusden JeroenVanLeusden commented Dec 2, 2019

Description (*)

Duplicating product will end up in endless loop which also keeps copying product images.

Fixed Issues (if relevant)

  1. Duplicating product copies product images couple of hundred times #9466: Duplicating product copies product images couple of hundred times (not sure if fully fixed by definitely related)

Manual testing scenarios (*)

  1. Create simple product with tier prices.
  2. Create 2nd store.
  3. Change url key of created simple on 2nd store scope.
  4. Change to default scope and save & duplicate product.

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Dec 2, 2019

Hi @JeroenVanLeusden. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@JeroenVanLeusden JeroenVanLeusden changed the title Save duplicated product using repository Prevent endless loop when duplicating product Dec 2, 2019
@JeroenVanLeusden JeroenVanLeusden added the Partner: Reach Digital Pull Request is created by partner Reach Digital label Dec 2, 2019
@JeroenVanLeusden JeroenVanLeusden force-pushed the JeroenVanLeusden-patch-4 branch 2 times, most recently from 683a22f to 589f2e8 Compare December 2, 2019 13:54
@ihor-sviziev ihor-sviziev self-assigned this Dec 3, 2019
Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @JeroenVanLeusden,
In general your changes looks good for me. Could you adjust your code according to my comment above and cover your changes with some test in order not to have regression in future?

@orlangur orlangur self-assigned this Dec 4, 2019
@sidolov sidolov changed the base branch from 2.3-develop to 2.4-develop December 5, 2019 17:05
@ihor-sviziev
Copy link
Contributor

Hi @JeroenVanLeusden,
Will you be able to update your PR? This is quite good improvement, I'd like to accept it.

@JeroenVanLeusden
Copy link
Member Author

Yes definitely! Didn't had time to update it yet, will try to find some soon.

@JeroenVanLeusden
Copy link
Member Author

@ihor-sviziev Added stopper and a testcase.

@ihor-sviziev
Copy link
Contributor

@magento run all tests

@ihor-sviziev
Copy link
Contributor

Failing unit tests are not related to changes from this PR

@engcom-Delta
Copy link
Contributor

✔️ QA passed

@ihor-sviziev
Copy link
Contributor

Missed to add - failing functional tests looks not related to changes from this PR

Copy link
Contributor

@lenaorobei lenaorobei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my comment regarding BC.
It should be avoided in the scope of 2.4-develop.

Remove redundant backward compatibility in constructor
@ihor-sviziev
Copy link
Contributor

@magento run all tests

@m2-assistant
Copy link

m2-assistant bot commented Feb 8, 2020

Hi @JeroenVanLeusden, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@JeroenVanLeusden JeroenVanLeusden deleted the JeroenVanLeusden-patch-4 branch February 14, 2020 09:38
@maxq
Copy link

maxq commented Feb 26, 2020

Not being much of a coder I have to ask how do I get the updated copier.php file? I presume I can just replace the fixed file in the 2.3.4 installation?

@PsmIndia
Copy link

PsmIndia commented Jun 30, 2020

Need Urgent Help, magento setup version is 2.3.4[upgraded m1], we have "29542 records found" products, i am facing duplicate product issue, try to fix using available patch but its not fix.

Today i remove all products images in test environment, there no image for a single product, now i add product image for a single product, i save it, working cool, but when i try to do duplicate this product, its again went into infinite loop, within few mints it create huge[4.3GB] garbage of that image that recently add. now i am helpless.

@sdzhepa sdzhepa mentioned this pull request May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants