magento2
magento2 copied to clipboard
Category URL Path issue in multi-store
Preconditions and environment
- Magento version 2.4.6 & 2.4.7
Steps to reproduce
- Create 2 stores ( default = 1, other_store = 2), same category root assigned.
- Create this category tree :
- Cat A (url key =
ain default view. url key =other_ain store 2)- Cat AB (url key =
bin default view)
- Cat AB (url key =
- Cat A (url key =
- Check
catalog_category_entity_varchartable where attribute_id =(ID of url_path)and category_id =(ID of cat AB). You should see :a/bfor store 0 andother-a/bfor store 2. - Check frontend canonical url for store2 - AB category page. You should see
https://.../other-a/b - Change url_key for cat AB, in default view, for
b2 - Check again
catalog_category_entity_varchartable where attribute_id in(ID of url_path)and category_id = (ID of cat AB). - Check again canonical url for store2 AB category page.
Expected result
a/b2for store 0 andother-a/b2for store 2.- Url of category =
https://.../other-a/b2, Canonical :https://.../other-a/b2
Actual result
a/b2for store 0 andother-a/bfor store 2.- Url of category =
https://.../other-a/b2, Canonical :https://.../other-a/b
Additional information
No response
Release note
No response
Triage and priority
- [ ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- [X] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- [ ] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- [ ] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- [ ] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Hi @Nuranto. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance- upcoming 2.4.x release- For more details, review the Magento Contributor Assistant documentation.
- Add a comment to assign the issue:
@magento I am working on this - To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues 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.
Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
- [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
- [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
- [ ] 3. Add
Area: XXXXXlabel to the ticket, indicating the functional areas it may be related to. - [ ] 4. Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced on 2.4.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here! - [ ] 5. Add label
Issue: Confirmedonce verification is complete. - [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hi @engcom-Dash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
-
- Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
-
- Verify that issue has a meaningful description and provides enough information to reproduce the issue.
-
- Add
Area: XXXXXlabel to the ticket, indicating the functional areas it may be related to.
- Add
-
- Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced on 2.4.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
- Verify that the issue is reproducible on
- Join Magento Community Engineering Slack and ask your questions in #github channel.
@magento give me 2.4-develop instance
Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Dash, here is your Magento Instance: https://b2c4c630e425172c56bb24d1a3bcaca5.instances-prod.magento-community.engineering Admin access: https://b2c4c630e425172c56bb24d1a3bcaca5.instances-prod.magento-community.engineering/admin_e95b Login: b0cf1897 Password: bd03976aface
Hi @Nuranto
Thanks for reporting and collaboration.
Verified the issue on magento 2.4 dev instance but the issue is not reproduceable.
Steps to reproduce
- Create 2 stores ( default = 1, other_store = 2), same category root assigned.
- Create this category tree : Cat A (url key = a in default view. url key = other_a in store 2) and Cat AB (url key = b in default view)
- Check catalog_category_entity_varchar table where attribute_id = (ID of url_path) and category_id = (ID of cat AB). You should see : a/b for store 0 and other-a/b for store 2.
- Check frontend canonical url for store2 - AB category page. You should see https://.../other-a/b
- Change url_key for cat AB, in default view, for b2
- Check again catalog_category_entity_varchar table where attribute_id in (ID of url_path) and category_id = (ID of cat AB).
- Check again canonical url for store2 AB category page.
We are seeing the below results :
a/b2 for store 0 and other-a/b2 for store 2. Url of category = https://.../other-a/b2, Canonical : https://.../other-a/b2
Please refer the screenshots attached. Let us know if we have missed anything.
I did more test, on several projects I'm working on. Also tried with all third-extensions disabled. I can reproduce the issue in all cases. I tried to change some configuration, but cannot manage to find the missing step to reproduce :/
I also checked the code, i don't saw anywhere the code that updates the url_path on all stores. There's src/vendor/magento/module-catalog-url-rewrite/Model/Category/Plugin/Category/UpdateUrlPath.php but it only deals with new categories (if ($category->isObjectNew()) and src/vendor/magento/module-catalog-url-rewrite/Observer/CategoryUrlPathAutogeneratorObserver.php but it only deals with children.
I guess I'm missing something...
Hi @engcom-Delta. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
- [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
- [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
- [ ] 3. Add
Area: XXXXXlabel to the ticket, indicating the functional areas it may be related to. - [ ] 4. Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced on 2.4.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here! - [ ] 5. Add label
Issue: Confirmedonce verification is complete. - [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hi @Nuranto,
Verified the issue on 2.4-develop and it is reproducible.
Hence, Confirming the issue.
Steps to reproduce:-
1.Create 2 stores ( default = 1, other_store = 1), same category root assigned. 2.Create this category tree : 3.Cat A (url key = a in default view. url key = other-a in store 1) Cat AB (url key = b in default view) 4.Check catalog_category_entity_varchar table where attribute_id = (ID of url_path) and category_id = (ID of cat AB). You should see : a/b for store 0 and other-a/b for store 2. 5.Check frontend canonical url for store2 - AB category page. You should see https://.../other-a/b 6.Change url_key for cat AB, in default view, for b2 7.Check again catalog_category_entity_varchar table where attribute_id in (ID of url_path) and category_id = (ID of cat AB). 8.Check again canonical url for store2 AB category page.
Please refer the attached screenshot.
Created one store other than default store
Same category assigned
Category A created and given url key = a in default view
url key = other-a in store 1 view
Category AB created and given url key = b in default view
Check catalog_category_entity_varchar table , a/b for store 0 and other-a/b for store 1.
frontend canonical url for store2 - AB category page. You should see https://.../other-a/b
Change url_key for cat AB, in default view, for b2
Check catalog_category_entity_varchar table
frontend canonical url for store2 - AB category page
Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x, ^Area:.*
Once all required labels are present, please add Issue: Confirmed label again.
Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x, ^Area:.*
Once all required labels are present, please add Issue: Confirmed label again.
Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x, ^Area:.*
Once all required labels are present, please add Issue: Confirmed label again.
Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x, ^Area:.*
Once all required labels are present, please add Issue: Confirmed label again.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-11859 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Delta. Thank you for verifying the issue.
Issue Available: @engcom-Delta, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-11859
:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-11859
:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-11859
@magento I am working on this
Hello,
Internal team has started to work on it
Thanks
Hi @Nuranto,
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.
Hi @engcom-Bravo,
I don't think this is working as expected. An normally non-destructive action in the backend, that can cause the url_path to differ per store even though they have the same url_key seems like a bug to me.
We have experienced this very same issue where we change the url_key, but the url_path doesn't update, with no way to solve this without the use of command line tools, or editing the database to manually fix the value of the url_path attribute.
@rustmaestro im stuck with the same issue at 2.4.6-p3.
Change of url_key doesn't translate to url_path change and there is no other way to update url_path from admin dashboard. Since you saved the category first time you are stuck with url_path forever without direct change in DB.
@engcom-Bravo, Real life problem it creates: You setup the store with initial categories:
- umbrella
- umrella/special
- umbrella/special/sun-protection
Then hire SEO agency which optimize them to:
- umbrella
- umrella/special
- umbrella/sun-protection They edit url key field on category form and edit url rewrites to match new url.
Later you decide to connect with 3rd party integration which reads your category urls from rest api endpoint. The endpoint serves them url_path 'umbrella/special/sun-protection' but correct one and actually used on page and all marketing channels is 'umbrella/sun-protection'. There is no way to retrieve url rewrites of a category from api (correct me?).
So now your developers have to sort out the mess with paths before you can use any backend integration related to categories.