Skip to content

Magento 2.4.7-p3 : Unable save "/" in the product url_key #39650

Open
@mohammadbharmal

Description

@mohammadbharmal

Preconditions and environment

  • Magento 2.4.7-p3

When creating a product in Magento 2.4.7-p3 with a url_key containing a forward slash ("/"), such as "test/product-123", Magento automatically replaces the "/" with a hyphen ("-") upon saving the product. As a result, the URL becomes "test-product-123".

However, if a manual URL rewrite is created for the same product, it is possible to save the original URL format "test/product-123" through the rewrite. This inconsistency in behaviour between automatic URL key generation and manual URL rewrites can lead to confusion and potential issues with URL management.

Image

Steps to reproduce

  • Create a product in Magento 2.4.7-p3 with the url_key set to "test/product-123".
  • Save the product.
  • Observe that Magento replaces the "/" with "-", resulting in the URL "test-product-123".
  • Create a manual from the Marketing > SEO & Search > URL rewrite for the same product and set the URL to "test/product-123".
  • Save the rewrite and note that the original URL format "test/product-123" is now accepted.

Expected result

Magento should either consistently allow or disallow the use of forward slashes ("/") in url_key values across both automatic product saving and manual URL rewrites.

Actual result

Magento replaces "/" with "-" during product save but allows "/" in manual URL rewrites, leading to inconsistent URL handling.

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Labels

Area: ProductComponent: UrlRewriteIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Reported on 2.4.7-p3Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type

Projects

Status

Ready for Development

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions