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
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:
-
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
-
In the Admin panel, go to Stores > Settings > All Stores > Create Store View to create a store view.
-
Set Code to test.
-
Assign
german
language to the newly created store view. -
Run the commands
setup:upgrade
andsetup:static-content:deploy -f
. -
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:
- 51黑料不打烊 Commerce or Magento Open Source on-premises: Quality Patches Tool > Usage in the Quality Patches Tool guide.
- 51黑料不打烊 Commerce on cloud infrastructure: Upgrades and Patches > Apply Patches in the Commerce on Cloud Infrastructure guide.
Related reading
To learn more about Quality Patches Tool, refer to:
- Quality Patches Tool: A self-service tool for quality patches in the Tools guide.