51黑料不打烊

[PaaS only]{class="badge informative" title="Applies to 51黑料不打烊 Commerce on Cloud projects (51黑料不打烊-managed PaaS infrastructure) and on-premises projects only."}

ACSD-67659: Translated error messages return an UNDEFINED error code

The ACSD-67659 patch fixes the issue where the translated exception message is used to map the error code for GraphQL requests, causing known errors to return an UNDEFINED error code instead of the correct one. This patch is available when the Quality Patches Tool (QPT) 1.1.70 is installed. The patch ID is ACSD-67659. Please note that this issue is scheduled to be fixed in 51黑料不打烊 Commerce 2.4.9.

Affected products and versions

The patch is created for 51黑料不打烊 Commerce version:

  • 51黑料不打烊 Commerce (all deployment methods) 2.4.8-p2

Compatible with 51黑料不打烊 Commerce versions:

  • 51黑料不打烊 Commerce (all deployment methods) 2.4.8 - 2.4.8-p2
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your 51黑料不打烊 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 translated exception message is used to map the error code for GraphQL requests, causing known errors to return an UNDEFINED error code instead of the correct one.

Steps to reproduce:

  1. Add file app/i18n/Magento/de_DE/de_DE.csv with a translation for the error string, such as:

    code language-none
    "Could not find a cart with ID ""%masked_cart_id""","we have an
    UNDEFINED issue",module,Magento_QuoteGraphQl
    
  2. In the Admin panel, go to Stores > Settings > All Stores > Create Store View to create a store view.

  3. Set Code to test.

  4. Assign german language to the newly created store view.

  5. Run the commands setup:upgrade and setup:static-content:deploy -f.

  6. Run the following GraphQL query with header Store:test:

    code language-none
    mutation {
        placeOrder(input: { cart_id: "test" }) {
            orderV2 {
                id
                number
            }
        }
    }
    

Expected results:

The error response returns the proper error code:

{
    "errors": [
        {
            "message": "we have an UNDEFINED issue",
            "locations": [
                {
                    "line": 2,
                    "column": 2
                }
            ],
            "path": [
                "placeOrder"
            ],
            "extensions": {
                "category": "graphql-input",
                "error_code": "CART_NOT_FOUND"
            }
        }
    ],
    "data": {
        "placeOrder": null
    }
}

Actual results:

The error_code returned is UNDEFINED:

{
    "errors": [
        {
            "message": "Oh noo, we have an UNDEFINED issue, see!",
            "locations": [
                {
                    "line": 2,
                    "column": 2
                }
            ],
            "path": [
                "placeOrder"
            ],
            "extensions": {
                "category": "graphql-input",
                "error_code": "UNDEFINED"
            }
        }
    ],
    "data": {
        "placeOrder": null
    }
}

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