Skip to content

url_key auto-updates on product name change via API in Magento 2.4.7 #40055

Closed
@L1ntothomas

Description

@L1ntothomas

Preconditions and environment

In Magento 2.4.7, when updating a product using the REST API (PUT /V1/products/:sku), if the name is changed and the url_key is not provided in the payload, Magento automatically updates the url_key based on the new name (e.g., name: "New Product" results in url_key: "new-product" or new-product-sku).

Steps to reproduce

1.Create a product via the API:
{
"product": {
"sku": "REF-EC53",
"name": "ecom categ product",
"attribute_set_id": 16,
"status": 1,
"visibility": "4",
"type_id": "simple",
"weight": 0.0,
"price": 1.0
}
}
2.Magento stores:
"url_key": "ecom-categ-product"

3.Update the product via the API (omit url_key):
{
"product": {
"sku": "REF-EC53",
"name": "ecom categ product1",
"attribute_set_id": 16,
"status": 1,
"visibility": "4",
"type_id": "simple",
"weight": 0.0,
"price": 1.0
}
}
4.Response shows:
"url_key": "ecom-categ-product-REF-EC53"

Expected result

Magento should preserve the existing url_key unless it is explicitly updated via the payload.

Actual result

If:
url_key is omitted from the request, and
name is changed,
Magento regenerates a new url_key, e.g., ecom-categ-product-REF-EC53.

Additional information

Magento should not auto-update the url_key if:
url_key is not included in the payload
Only name is updated
This behavior should either be:
Removed, or
Controlled via a configuration setting

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.7Indicates 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