ACSD-45168: SEO-friendly URLs not generated for products that have url_key attributes overridden

The ACSD-45168 patch fixes the issue where SEO-friendly URLs are not generated for products that have url_key attributes overridden on the store-view level. This patch is available when the Quality Patches Tool (QPT) 1.1.24 is installed. The patch ID is ACSD-45168. Please note that the issue is scheduled to be fixed in Adobe Commerce 2.4.6.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce (all deployment methods) 2.4.5

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.4.2 - 2.4.5-p1
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.

Issue

SEO-friendly URLs are not generated for products that have url_key attributes overridden on the store-view level.

Steps to reproduce:

  1. Set the configuration as follows by going to the Commerce Admin > Stores > Settings > Configuration > Catalog > Search Engine Optimization:

    • Use Categories Path for Product URLs = Yes
    • Generate “category/product” URL Rewrites = Yes
  2. Clean the configuration cache.

  3. Create two categories: Category 1 and Category 2.

  4. Create two products: Product 1 in Category 1, Product 2 in Category 1.

  5. Change the scope to Default Store View for Product 1.

  6. Uncheck the optional URL Key in Search Engine Optimization.

  7. Save the product.

  8. Switch back to All Store Views.

  9. Add Product 1 to Category 2, and add Product 2 to Category 2.

  10. Check the url_rewrite table or Marketing > SEO & Search > URL Rewrites.

Expected results:

The SEO-friendly URL for Category 2 is created for Product 1.

Actual results:

The SEO-friendly URL for Category 2 is missing for Product 1 because it had the URL key attribute overwritten for the store view scope.

Apply the patch

To apply individual patches, use the following links depending on your deployment method:

For info about other patches available in QPT, refer to Quality Patches Tool: Search for patches in the Quality Patches Tool guide.

recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3