Skip to content
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

URL Rewrites vs multiple storeviews - a never ending battle #11615

Closed
hostep opened this issue Oct 21, 2017 · 5 comments
Closed

URL Rewrites vs multiple storeviews - a never ending battle #11615

hostep opened this issue Oct 21, 2017 · 5 comments
Assignees
Labels
Component: CatalogUrlRewrite Event: distributed-cd Distributed Contribution Day Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@hostep
Copy link
Contributor

hostep commented Oct 21, 2017

I'm pretty sure this has been reported before, but please excuse me if I didn't find the correct duplicate, since there are so many issues being reported around this. If there is an exact duplicate, please mark this issue as a duplicate and close it.
My hope is to provide a easy reproducible case which can easily be tested and maybe finally put this big issue a bit more in the spotlight.

Preconditions

  1. PHP 7.0.24
  2. Both Magento 2.1.9 and 2.2.0 (the situation in 2.2.0 is slightly better then 2.1.9, but there are still problems)

Steps to reproduce

  1. Setup a Magento 2.1.9 and 2.2.0 installation separately and execute all the steps mentioned below on both of them
  2. In the backend, go to Stores > Configuration > Catalog > Catalog > Search Engine Optimization and change the configuration 'Use Categories Path for Product URLs' to 'Yes'
  3. In the backend, go to Stores > All Stores and make sure you have 2 storeviews, I'm using 'Dutch' and 'French' as examples here
  4. In the backend, go to Catalog > Categories and create 2 subcategories with the following url keys in the default values and 2 storeview specific (don't check the 'Create Permanent Redirect for old URL' checkbox while doing so):
Tree Name Default Dutch French
Default Category/Level 1 Level 1 level-1 level-1-nl level-1-fr
Default Category/Level 1/Level 2 Level 2 level-2 level-2-nl level-2-fr
  1. At this point, the url rewrites in the database table are correct, so no issues here
  2. In the backend, go to Catalog > Products and create a new simple product. I named it 'Product 1'. Assign it to the category 'Level 2', not on any category above it.
  3. Check the url_rewrite table in the database, it is different in Magento 2.1.9 and 2.2.0, in 2.2.0 it is slightly better then in 2.1.9, but still not bug free

Expected result

request_path target_path store_id
level-1-nl.html catalog/category/view/id/3 1
level-1-nl/level-2-nl.html catalog/category/view/id/4 1
level-1-fr.html catalog/category/view/id/3 2
level-1-fr/level-2-fr.html catalog/category/view/id/4 2
product-1.html catalog/product/view/id/1 1
level-1-nl/level-2-nl/product-1.html catalog/product/view/id/1/category/4 1
level-1-nl/product-1.html catalog/product/view/id/1/category/3 1
product-1.html catalog/product/view/id/1 2
level-1-fr/level-2-fr/product-1.html catalog/product/view/id/1/category/4 2
level-1-fr/product-1.html catalog/product/view/id/1/category/3 2

Actual result

Magento 2.1.9

request_path target_path store_id
level-1-nl.html catalog/category/view/id/3 1
level-1-nl/level-2-nl.html catalog/category/view/id/4 1
level-1-fr.html catalog/category/view/id/3 2
level-1-fr/level-2-fr.html catalog/category/view/id/4 2
product-1.html catalog/product/view/id/1 1
level-1/level-2/product-1.html catalog/product/view/id/1/category/4 1
level-1/product-1.html catalog/product/view/id/1/category/3 1
product-1.html catalog/product/view/id/1 2
level-1/level-2/product-1.html catalog/product/view/id/1/category/4 2
level-1/product-1.html catalog/product/view/id/1/category/3 2

Magento 2.2.0

request_path target_path store_id
level-1-nl.html catalog/category/view/id/3 1
level-1-nl/level-2-nl.html catalog/category/view/id/4 1
level-1-fr.html catalog/category/view/id/3 2
level-1-fr/level-2-fr.html catalog/category/view/id/4 2
product-1.html catalog/product/view/id/1 1
level-1-nl/level-2-nl/product-1.html catalog/product/view/id/1/category/4 1
level-1/product-1.html catalog/product/view/id/1/category/3 1
product-1.html catalog/product/view/id/1 2
level-1-fr/level-2-fr/product-1.html catalog/product/view/id/1/category/4 2
level-1/product-1.html catalog/product/view/id/1/category/3 2
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Oct 21, 2017
@orlangur
Copy link
Contributor

Assign it to the category 'Level 2', not on any category above it.

"Default Category/Level 1" has ID=3, right? Is problematic product actually available in this category? Display Settings > Anchor is set to No?

@hostep
Copy link
Contributor Author

hostep commented Oct 21, 2017

Correct. 'Level 1' is ID 3, 'Level 2' is ID 4.
Product is available in both 'Level 1' and 'Level 2' because Anchor is by default set to 'Yes'.

@orlangur
Copy link
Contributor

Oh, sorry, I missed the "expected result" part :)

Category URL Key is received from global instead of store view scope, should be
level-1/product-1.html -> level-1-nl/product-1.html
level-1/product-1.html -> level-1-fr/product-1.html

@orlangur orlangur added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Oct 21, 2017
@magento-engcom-team
Copy link
Contributor

@hostep, thank you for your report.
We've created internal ticket(s) MAGETWO-82506 to track progress on the issue.

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 23, 2017
@magento-engcom-team magento-engcom-team added the Event: distributed-cd Distributed Contribution Day label Mar 19, 2018
@mszydlo mszydlo self-assigned this Mar 24, 2018
@ghost ghost unassigned mszydlo Sep 27, 2019
@slavvka
Copy link
Member

slavvka commented Mar 17, 2020

@slavvka slavvka added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Mar 17, 2020
@slavvka slavvka closed this as completed Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: CatalogUrlRewrite Event: distributed-cd Distributed Contribution Day Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

7 participants