Skip to content

Category Update API resets available_sort_by to use config value #32596

Closed
@lewisvoncken

Description

@lewisvoncken

Preconditions (*)

  1. Magento 2.4

Steps to reproduce (*)

  1. Create a Category in the admin and specify a value for available_sort_by
  2. Execute the following api (change the id based on your created category)
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://example.com/rest/all/V1/categories/1321',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_POSTFIELDS =>'{
    "category": {
        "name": "Example Category",
        "parent_id": "25",
        "id": "1321",
        "custom_attributes": [
            {
                "attribute_code": "url_key",
                "value": "example-category"
            }
        ]
    }
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer xxxxxxxxxxx',
    'Cookie: PHPSESSID=2kansl4q65fupe9jn1ptrl6j2q; XDEBUG_SESSION=PHPSTORM'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Expected result (*)

image

Actual result (*)

image


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • 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

Component: BackendComponent: CatalogComponent: WebapiUse with concrete module component label E.g. "Component: Webapi" + "Catalog"Issue: 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.Progress: doneReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions