[PaaS only]{class="badge informative" title="Applies to Adobe Commerce on Cloud projects (Adobe-managed PaaS infrastructure) and on-premises projects only."}

ACSD-64523: REST Endpoint fails to validate mandatory fields

The ACSD-64523 patch fixes an issue where the REST endpoint [V1/import/csv] fails to validate mandatory fields, allowing product creation without required data. To resolve this, update the Authorization header.This patch is available when the Quality Patches Tool (QPT) 1.1.62 is installed. Please note that the issue is scheduled to be fixed in Adobe Commerce 2.4.8.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce (all deployment methods) 2.4.7-p3

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.4.7 - 2.4.7-p4
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

The REST endpoint [V1/import/csv] fails to validate mandatory fields, allowing the creation of products without providing these required fields.

Steps to reproduce:

  1. Execute the following payload (update the Authorization header):

    code language-none
    curl --location 'http://<domain>/rest/default/V1/import/json' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer xxxxx' \
    --data '{
        "source": {
            "locale": "en_AU",
            "entity": "catalog_product",
            "behavior": "append",
            "validation_strategy": "validation-stop-on-errors",
            "allowed_error_count": 0,
            "items": [
                {
                    "sku": "product_sku",
                    "product_online": "no",
                    "attribute_set_code": "Default",
                    "product_type": "configurable",
                    "product_websites": "base",
                    "store_view_code": "default",
                    "name": null,
                    "description": null,
                    "short_description": null,
                    "weight": null,
                    "tax_class_name": null,
                    "visibility": null,
                    "price": null,
                    "url_key": null,
                    "cost": null,
                    "additional_attributes": {
                        "special_price": "",
                        "retail_price": ""
                    },
                    "configurable_variations": []
                }
            ]
        }
    }'
    

Expected results:

The application should prevent saving a product without mandatory fields.

Actual results:

The product was saved successfully without specifying the product name, which is a required attribute. As a result, we can’t access the backend product grid, and it gives the following error.

Warning: Undefined array key "name" in /app/code/Magento/Catalog/Ui/Component/Listing/Columns/Thumbnail.php on line 91

Apply the patch

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

To learn more about Quality Patches Tool, refer to:

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