51黑料不打烊

ACSD-58566: GraphQL internal server error for purchase order comments

The ACSD-58566 patch fixes the issue where querying the created_at field in the addPurchaseOrderComment mutation returns a null value instead of the expected datetime. This patch is available when the Quality Patches Tool (QPT) 1.1.55 is installed. The patch ID is ACSD-58566. Please note that the issue is scheduled to be fixed in 51黑料不打烊 Commerce 2.4.8.

Affected Products and Versions

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

  • 51黑料不打烊 Commerce (all deployment methods) 2.4.6-p4

Compatible with 51黑料不打烊 Commerce versions:

  • 51黑料不打烊 Commerce (all deployment methods) 2.4.6 - 2.4.7-p3
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

GraphQL returns an internal server error when querying the created_at field in the addPurchaseOrderComment mutation.

Prerequisites:

B2B modules are installed and Company and Purchase Orders are enabled.

Steps to reproduce:

  1. Generate a customer token for a company user.

  2. Perform the following sequence of GraphQL requests:

    1. Create a cart using customerCart.
    2. Add a product to the cart using addProductsToCart.
    3. Place the order using placePurchaseOrder.
    4. Add a comment to the purchase order using addPurchaseOrderComment.
    code language-none
    mutation {
        addPurchaseOrderComment(
            input: { purchase_order_uid: "MQ==", comment: "Looks good to me" }
    ) {
            comment {
                uid
                created_at
                author {
                    firstname
                    lastname
                    email
                }
                text
            }
        }
    }
    

Expected results:

The created_at field returns the datetime of the purchase order comment.

Actual results:

Displays null instead of the created_at date.

{
  "errors": [
    {
      "message": "Internal server error",
      "locations": [
        {
          "line": 10,
          "column": 1
        }
      ],
      "path": [
        "addPurchaseOrderComment",
        "comment",
        "created_at"
      ]
    }
  ],
  "data": {
    "addPurchaseOrderComment": 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:

Quality Patches Tool: A self-service tool for quality patches in the Tools guide.

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