-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Improve category url integrity #38672
Improve category url integrity #38672
Conversation
Hi @digitalrisedorset. Thank you for your contribution! Add the comment under your pull request to deploy test or vanilla Magento instance:
❗ Automated tests can be triggered manually with an appropriate comment:
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@magento run all tests |
Hello, Internal team has started to work on it Thanks |
@magento run all tests |
As internal team is started working on this PR. We are moving this PR |
Thanks for your Contribution!!. Internal Team analysed the issue and this is adobe commerce default behaviour and not a bug. We discussed this internally with the product owner and confirmed that this is working as expected. We will not be modifying the functionality at this time. Thank You. |
When the category is saved in Magento backend and particularly when the scope is a custom store, some use cases leave some url key or url path with data that break features like the canonical url in the category page on the frontend.
Description (*)
The changes are twofold:
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
use case 1: the category url key is set for the global scope and a different value is set for the store scope 2
use case 2: starting with a parent category like the above (with 2 scope set), the child category url key is set for the global scope and the category url key is not set for either of the default store or custom store: only store 0 has a url key
global scope: store id = 0, url path: cat1/cat12
use case 3: the child category uses a url key for the global scope (store 0) and uses a custom url key (cat12_2) for the custom store (store 2)
use case 4: the child category uses a url key for the default store scope (store = 1) (cat12_1) and uses no custom url key for the custom store (store 2)
use case 5: the child category uses a custom url key (cat12_1) for the global scope and uses a custom url key (cat12_2) for the custom store (store 2)
Questions or comments
The PR changes resolve the issue with canonical url being invalid. However, if the parent category url is changed afterwards, it does break the category path. I have attempted to add integration tests but this attempt was shortlived once I realised the category save process cannot be triggered by a single method but rather by using a list of events/plugins and resources. If we wanted this area of the system bug free, we'd need this area (category backend save controller) to be refactored
The changes duplicate existing snippets to try to keep the other logic to work like before as much as possible.
Contribution checklist (*)