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

Updating the value of "catalog/seo/category_url_suffix" or "catalog/seo/product_url_suffix" can cause Magento to silently fail to update URL rewrites #17614

Open
simonworkhouse opened this issue Aug 15, 2018 · 13 comments
Assignees
Labels
Component: CatalogUrlRewrite Component: Deploy Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: dev in progress 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 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.

Comments

@simonworkhouse
Copy link

After updating the value of either "catalog/seo/category_url_suffix" or "catalog/seo/product_url_suffix" it is possible to create another product or category that matches the same expected URL rewrite path as conflicts won't be reported due to the difference in URL keys.
If a common parent category of these conflicting entities has it's URL key changed, both entities may have their URL rewrites updated to have the same request path which will cause only the latest category to have the rewrites updated and no errors generated.

Preconditions

  1. Magento 2.2.5
  2. PHP 7.1.20
  3. MySQL 5.7.23

Steps to reproduce

  1. composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition {install dir}
  2. cd {install dir}
  3. ./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=?
  4. ./bin/magento deploy:mode:set developer
  5. ./bin/magento app:config:dump
  6. ./bin/magento cache:disable
  7. Confirm that the value for "catalog/seo/category_url_suffix" is ".html" (the default value)
  8. Proceed to the admin panel and create a sub-category called "Sale" with the URL key of "sale"
  9. Create a sub-category under "Sale" called "Sandwiches" with the URL key of "sandwiches"
  10. Now update the name of the new category from "Sandwiches" to "Sandwiches Old" (NOTE: This step is just to simulate user behaviour and highlight the potential of conflicts when importing data)
  11. Update the value of "catalog/seo/category_url_suffix" to ".php" and run "./bin/magento app:config:import"
  12. Create another sub-category under "Sale" called "Sandwiches" with the URL key of "sandwiches"
  13. Update the value of "catalog/seo/category_url_suffix" to ".test" and run "./bin/magento app:config:import"
  14. 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 at the very least a warning notifying the admin user of conflicts in the url_rewrite table should be shown.

Actual result

A success message saying "You saved the category." is displayed to the admin user and only the latest category/product has the URL rewrites updated.

@magento-engcom-team
Copy link
Contributor

Hi @simonworkhouse. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me {$VERSION} instance

where {$VERSION} is version tags (starting from 2.2.0+) or develop branches (2.2-develop +).
For more details, please, review the Magento Contributor Assistant documentation.

@simonworkhouse do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Aug 15, 2018
@engcom-backlog-nickolas

Hello @simonworkhouse, thank you for your report. I'm not able to reproduce this issue. On step 12:

Create another sub-category under "Sale" called "Sandwiches" with the URL key of "sandwiches"

I've got error message:
url_rewrite

Could you please add more details?

@simonworkhouse
Copy link
Author

@engcom-backlog-nickolas Is your cache disabled? Try a "./bin/magento cache:flush" as the final URL should end in ".test" not ".php"

@engcom-backlog-nickolas

@simonworkhouse, yes cache is disabled. Why it should ended with ".test"? Suffix ".test" is set at step 13. And I cannot get to 13th step.

@simonworkhouse
Copy link
Author

@engcom-backlog-nickolas Yes, try monitoring changes to the url_rewrite as you proceed through the steps. I'll have someone re-check the instructions.

@simonworkhouse
Copy link
Author

@engcom-backlog-nickolas I have had others independently run through the process and they were able to replicate the issue as described. Also, you won't be able to test this issue and the other related issues that have been reported at the same time, you will have to start from a fresh install for each.

@engcom-backlog-nickolas

@simonworkhouse
peek 2018-08-15 16-04

Please correct my steps, or add more details.

@simonworkhouse
Copy link
Author

@engcom-backlog-nickolas Try updating the url suffixes directly in the config.php file.

@engcom-backlog-nickolas engcom-backlog-nickolas added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development 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 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 Component: Deploy and removed Progress: needs update labels Aug 16, 2018
@engcom-backlog-nickolas engcom-backlog-nickolas removed their assignment Aug 16, 2018
@ghost ghost removed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed 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 labels Oct 20, 2020
@magento-engcom-team magento-engcom-team added Priority: P3 May be fixed according to the position in the backlog. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Nov 30, 2020
@stale
Copy link

stale bot commented Feb 15, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!

@stale stale bot added the stale issue label Feb 15, 2021
@simonworkhouse
Copy link
Author

This issue is still relevant.

@stale stale bot removed the stale issue label Feb 15, 2021
@stale
Copy link

stale bot commented May 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!

@stale stale bot added the stale issue label May 2, 2021
@simonworkhouse
Copy link
Author

This issue is still relevant.

@stale stale bot removed the stale issue label May 5, 2021
@engcom-Delta engcom-Delta self-assigned this May 20, 2024
Copy link

m2-assistant bot commented May 20, 2024

Hi @engcom-Delta. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

    1. Add/Edit Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced 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!
    1. If the issue is not relevant or is not reproducible any more, feel free to close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: CatalogUrlRewrite Component: Deploy Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: dev in progress 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 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
Status: Dev In Progress
Development

No branches or pull requests

5 participants