ACP2E-4799: GraphQL query requisition_lists returns incorrect total_count with pagination

The ACP2E-4799 patch fixes the issue where the requisition_lists GraphQL query returns an incorrect total_count value that reflects only the number of items on the current page instead of the total number of requisition list entities matching the query criteria. This patch is available when the Quality Patches Tool (QPT) 1.1.82 is installed. The patch ID is ACP2E-4799. Please note that this issue is scheduled to be fixed in Adobe Commerce B2B 1.5.4.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce (all deployment methods) B2B 1.5.2-p4

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) B2B >=1.5.0 <1.5.3
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe 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

When customers query requisition lists with pagination, the total_count field does not reflect the full number of matching requisition lists. Instead, it reports only the number of items returned for the current page, which makes the pagination metadata inaccurate.

Prerequisites:

Requisition lists are enabled for Adobe Commerce B2B.

Steps to reproduce:

  1. In the Admin, go to Stores > Settings > Configuration.

  2. In the left panel under General, choose B2B Features.

  3. Set Enable Requisition List to Yes and select Save Config.

  4. Sign in to the storefront as a customer.

  5. Choose My Requisition Lists and create six requisition lists.

  6. Ensure that the customer has exactly six requisition lists and that each list name contains ABC, so all six lists match the filtered query.

  7. Run the following GraphQL query with pageSize set to two and currentPage set to one:

    code language-graphql
    query {
      customer {
        requisition_lists(
          pageSize: 2
          currentPage: 1
        ) {
          items {
            uid
            name
          }
          total_count
          page_info {
            current_page
            page_size
            total_pages
          }
        }
      }
    }
    
  8. Run this GraphQL query:

    code language-graphql
    query {
      customer {
        requisition_lists(
          filter: { name: { match: "%ABC%" } }
          pageSize: 2
          currentPage: 1
        ) {
          items {
            uid
            name
          }
          total_count
          page_info {
            current_page
            page_size
            total_pages
          }
        }
      }
    }
    

Expected results:

  • The requisition_lists query returns total_count equal to the total number of requisition lists owned by the customer, independent of pageSize and currentPage.
  • The pagination data remains consistent with the full matching result set.

Actual results:

total_count returns only the number of items in the current page, such as two instead of six.

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
commerce-operations-help-tools