Open
Description
Updating the values of "catalog/seo/product_url_suffix", "catalog/seo/category_url_suffix" and "catalog/seo/product_use_categories" can cause Magento to fail to update the entries in the url_rewrite table while showing an error with a link to a non-existent rewrite.
Preconditions
- Magento 2.2.5
- PHP 7.1.20
- MySQL 5.7.23
Steps to reproduce
- composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition {install dir}
- cd {install dir}
- ./bin/magento setup:install --backend-frontname=? --db-host=? --db-name=? --db-user=? --db-password=? --base-url=? --admin-user=? --admin-password=? --admin-email=? --admin-firstname=? --admin-lastname=?
- ./bin/magento deploy:mode:set developer
- ./bin/magento app:config:dump
- ./bin/magento cache:disable
- Confirm that the values for "catalog/seo/product_url_suffix" and "catalog/seo/category_url_suffix" are ".html" and the value for "catalog/seo/product_use_categories" is "0" (the default values)
- Proceed to the admin panel and create a sub-category called "Sale" with the URL key of "sale"
- Create a sub-category under "Sale" called "Sandwiches" with the URL key of "sandwiches"
- Update the value of "catalog/seo/product_url_suffix" and "catalog/seo/category_url_suffix" to ".php" and run "./bin/magento app:config:import"
- Create a product called "Sandwiches" with the URL key of "sandwiches" and add it to the "Sale" category
- Update the values for "catalog/seo/product_url_suffix" and "catalog/seo/category_url_suffix" to ".test", the value for "catalog/seo/product_use_categories" to "1" and run "./bin/magento app:config:import"
- Update the URL key for the "Sale" category from "sale" to "sale-test"
Expected result
The URL keys for categories should never have been allowed to conflict like this and any warnings linking to URL rewrites should always link to existing entries.
Actual result
An error stating the following is displayed:
The value specified in the URL Key field would generate a URL that already exists.
To resolve this conflict, you can either change the value of the URL Key field (located in the Search Engine Optimization section) to a unique value, or change the Request Path fields in all locations listed below:
- sale-test/sandwiches.test
The link "sale-test/sandwiches.test" points to a record in the url_rewrite table that doesn't exist as the transaction that contained the insert for this entry was rolled back.
Metadata
Metadata
Assignees
Labels
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmedMay be fixed according to the position in the backlog.The issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 releaseAffects non-critical data or functionality and does not force users to employ a workaround.Issue related to Developer Experience and needs help with Triage to Confirm or Reject it