ACSD-66139: GraphQL order fails with ‘UNDEFINED’ error for inactive cart
The ACSD-66139 patch fixes the issue where, when placing an order for a non-existent or inactive cart, GraphQL returns an UNDEFINED error code instead of a specific one when error messages are translated. This patch is available when the Quality Patches Tool (QPT) 1.1.67 is installed. The patch ID is ACSD-66139. Please note that this issue is scheduled to be fixed in ÃÛ¶¹ÊÓÆµ Commerce 2.4.9.
Affected products and versions
The patch is created for ÃÛ¶¹ÊÓÆµ Commerce version:
- ÃÛ¶¹ÊÓÆµ Commerce (all deployment methods) 2.4.7-p5
Compatible with ÃÛ¶¹ÊÓÆµ Commerce versions:
- ÃÛ¶¹ÊÓÆµ Commerce (all deployment methods) 2.4.7 - 2.4.7-p6
magento/quality-patches
package to the latestvers ion 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
GraphQL returns an UNDEFINED error code instead of a specific one when placing an order for a non-existent or inactive cart, if the error message is translated.
Steps to reproduce:
- Add
app/i18n/Magento/de_DE/de_DE.csv
and include the following error string translation:
"Could not find a cart with ID ""%masked_cart_id""","Oh noo, we have an UNDEFINED issue, see!",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
setup:upgrade
andsetup:static-content:deploy -f
. - Run the following GraphQL query with header
Store:test
:
mutation {
placeOrder(input: { cart_id: "test" }) {
orderV2 {
id
number
}
}
}
Expected results:
Correct error response:
{
"errors": [
{
"message": "Oh noo, we have an UNDEFINED issue, see!",
"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:
- ÃÛ¶¹ÊÓÆµ Commerce or Magento Open Source on-premises: Quality Patches Tool > Usage in the Quality Patches Tool guide.
- ÃÛ¶¹ÊÓÆµ 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.