-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Delete existing URL rewrite IDs in After Replace #34791
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
Delete existing URL rewrite IDs in After Replace #34791
Conversation
Hi @amenk. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review. For more details, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento give me 2.4.3 instance |
Hi @amenk. Thank you for your request. I'm working on Magento instance for you. |
Hi @amenk, here is your Magento Instance: https://9345e2348ec7151e91a385b1e42b2423-2-4-3.instances.magento-community.engineering |
related: #33770 |
The functional tests seem to fail because of other reasons, I cannot imagine those errors are related to my PR. @ihor-sviziev can you review this as you were involved in the releated issue? |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Thank you for your feedback. I was not able to reproduce this on a clean Magento installation, it seems a complex case. From a logical point of view it makes sense to me - when hooking in the afterReplace - to actually replace items and not just insert them. That's why I inserted the delete before the insert. |
@amenk, I wonder how we can check that this change will fix the issue if we can't reproduce it. |
@ihor-sviziev Yes, very good point. |
@amenk, sorry, I don't have enough time to test it now. Maybe you could share with someone who will be checking this PR? |
@magento run Functional Tests EE, Functional Tests CE |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Storage.php
Outdated
Show resolved
Hide resolved
✔️ QA Passed Preconditions:
Manual testing scenario:
Before: ✖️ We had been getting exception while importing. After: ✔️ flies getting imported successfully. |
app/code/Magento/CatalogUrlRewrite/Model/ResourceModel/Category/Product.php
Outdated
Show resolved
Hide resolved
Make constant public again Co-authored-by: Pieter Hoste <hoste.pieter@gmail.com>
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Hi @ihor-sviziev, thank you for the review. |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Any movement on this? This issue is affecting every developer on our team, and the PR appears to have been sitting stagnant for over a month. |
@amenk the patch created doesn't seem to address the lack of auto increment on this catalog_url_rewrite_product_category table? So for example in our setup for this client, it should be auto incrementing from around 118669 as the next new ID to go in, starting off from previous of 118668, but the Magento system is trying to add various that start 117xxx when a product is saved in a new category, which suggests it has wrong stamp on where to start the ID? As far as I can see, the patch doesn't address any of this? |
@burgh8wp nothing was changed with the auto increments, yes. Probably a different issue? |
@amenk unsure, but just keen to understand why auto increment is not on url_rewrite_id for this table? Would that not be a simple solution that fully resolves and prevents duplicates occurring where it has a primary key there? |
It is possible that the entries in the
catalog_url_rewrite_product_category
table already exist. So as we are in a replace interceptor, we have to take care of this and not just insert additional entries.Description (*)
We saw errors like
after saving categories. This pull request fixes the issue.
I do not have a single clue if this reproducible in a stock Magento installation.
Manual testing scenarios (*)
Questions or comments
Fixed issues
Please tell me if that makes sense
Contribution checklist (*)