Closed
Description
This case demonstrates that too many url rewrites are being generated
It happens in Magento 2.4-develop, I tested it in 2.2 and over there it works as expected
Preconditions
- PHP 7.2
- Magento 2.4-develop
Steps to reproduce
- Setup a Magento 2.4-develop installation
- In the backend, go to Stores > Configuration > Catalog > Catalog > Search Engine Optimization and change the configuration 'Use Categories Path for Product URLs' to 'Yes'
- In the backend, go to Stores > All Stores and make sure you have 2 storeviews, I'm using 'Dutch' and 'French' as examples here
- 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 |
- In the backend, go to Catalog > Products and create a new simple product. I named it 'Product 2'. Assign it to both categories 'Level 1' and 'Level 2'
- Check the
url_rewrite
table in the database
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-2.html | catalog/product/view/id/2 | 1 |
level-1-nl/product-2.html | catalog/product/view/id/2/category/3 | 1 |
level-1-nl/level-2-nl/product-2.html | catalog/product/view/id/2/category/4 | 1 |
product-2.html | catalog/product/view/id/2 | 2 |
level-1-fr/product-2.html | catalog/product/view/id/2/category/3 | 2 |
level-1-fr/level-2-fr/product-2.html | catalog/product/view/id/2/category/4 | 2 |
Actual result
Magento 2.4-develop
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-2.html | catalog/product/view/id/2 | 1 |
level-1-nl/product-2.html | catalog/product/view/id/2/category/3 | 1 |
level-1-nl/level-2-nl/product-2.html | catalog/product/view/id/2/category/4 | 1 |
level-1/product-2.html | catalog/product/view/id/2/category/3 | 1 |
product-2.html | catalog/product/view/id/2 | 2 |
level-1-fr/product-2.html | catalog/product/view/id/2/category/3 | 2 |
level-1-fr/level-2-fr/product-2.html | catalog/product/view/id/2/category/4 | 2 |
level-1/product-2.html | catalog/product/view/id/2/category/3 | 2 |
The two rows in bold shouldn't be generated.
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.4-develop branchGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.4-develop branch