Skip to content

Category Url Rewrite not correctly generated when updating url_key through API #39632

@SteffenCH

Description

@SteffenCH

Preconditions and environment

  • Magento version: 2.4.* ( Tested on 2.4.6)

When updating an url_key in backend/admin, url rewrites are created from old-url to new-url, and new-url to category/view/id/{id} as expected.

Updating through REST API "V1/categories" (POST) results in only new-url to category/view/id/{id} being generated, essentially losing the connection between old-url to new-url and thus losing valuable SEO potential.

Steps to reproduce

  • Ensure "Create Permanent Redirect for URLs if URL Key Changed" is enabled in:
    Stores > Configuration > Catalog > Catalog > Search Engine Optimization

  • Update url_key through REST API "V1/categories" (POST)

  • Observe

Expected result

Url rewrites should be created from old-url to new-url, and new-url to category/view/id/{id} when updating url_key through API

Actual result

Only new-url to category/view/id/{id} urls is genereated when updating url_key through API, thus losing connection between old url and new url.

Additional information

This is quite critical as it basically means that any shop managing its categories through the api with an external system can't reliably generate category urls without losing valuable SEO.

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

Assignees

Labels

Issue: needs updateAdditional information is require, waiting for responseReported on 2.4.6Indicates original Magento version for the Issue report.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions