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
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:
-
In the Admin, go to Stores > Settings > Configuration.
-
In the left panel under General, choose B2B Features.
-
Set Enable Requisition List to Yes and select Save Config.
-
Sign in to the storefront as a customer.
-
Choose My Requisition Lists and create six requisition lists.
-
Ensure that the customer has exactly six requisition lists and that each list name contains
ABC, so all six lists match the filtered query. -
Run the following GraphQL query with
pageSizeset to two andcurrentPageset 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 } } } } -
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_listsquery returnstotal_countequal to the total number of requisition lists owned by the customer, independent ofpageSizeandcurrentPage. - 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:
- 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