ACSD-62965: Fixes missing LocalizedException
message in GraphQL order placement response
CREATED FOR:
- Experienced
- Admin
- Developer
The ACSD-62965 patch fixes the issue where the LocalizedException
message was not included in the GraphQL response during order placement. This patch is available with the Quality Patches Tool (QPT) 1.1.57. The patch ID is ACSD-62965. 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
Compatible with Adobe Commerce versions:
Adobe Commerce (all deployment methods) 2.4.7 - 2.4.7-p3
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 GraphQL response for order placement does not include a LocalizedException
message, resulting in insufficient error details for debugging.
Steps to reproduce:
-
Install a clean Adobe Commerce instance.
-
Add a product to the cart and proceed to the order placement step.
-
Add a
LocalizedException
toMagento\Framework\Exception\LocalizedException
inapp/code/Magento/QuoteGraphQl/Model/Resolver/PlaceOrder.php
. -
Insert the exception after the following line:
$cart = $this->getCartForCheckout->execute($maskedCartId, $userId, $storeId);
Add the exception:
throw new LocalizedException(new Phrase("Test LocalizedException"));
-
Execute the place order GraphQL request:
mutation { placeOrder(input: {cart_id: "cart_id"}) { order { order_number } } }
-
Observe the response:
-
The response does not include the
LocalizedException
message. -
Example of the incorrect response:
{ "data": { "placeOrder": { "order": null } } }
-
Expected results:
If a LocalizedException
occurs, the exception message should be included in the order placement GraphQL response for improved error handling.
Actual results:
If a LocalizedException
occurs, the exception message is not included in the order placement GraphQL response.
Apply the patch
To apply individual patches, use the following links depending on your deployment method:
- Adobe Commerce or Magento Open Source on-premises: Quality Patches Tool > Usage in the Quality Patches Tool guide.
- Adobe 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.