Skip to content

Category URL rewrites not generated for new stores #17583

@simonworkhouse

Description

@simonworkhouse

When a new website/store is created URL rewrites are only generated for the new store if a category's url_key is updated.
There doesn't appear to be any mechanism to re-generate these URL rewrites for a store, and they also don't take into account any changes to the "catalog/seo/category_url_suffix" configuration value.

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 sampledata:deploy
  5. ./bin/magento setup:upgrade
  6. Visit the admin panel and create a new website, store and store view using the same root category as the default store.

Expected result

Visiting category URLs on the frontend of the new store should match the URLs on the frontend of the default store.
Also, entries for the now store should exist in the url_rewrite table.

Actual result

URLs for the new store are in the format "/catalog/category/view/s/{url_key}/id/{category_id}/" while the default store has the expected URL format.
Also, no entries for the new store exist in the url_rewrite table and there doesn't appear to be any way to generate these short of updating the URL key for each category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CatalogUrlRewriteIssue: Cannot ReproduceCannot reproduce the issue on the latest `2.4-develop` branchIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions