ACP2E-4799: GraphQL查询requisition_lists返回带有分页的不正确的total_count
ACP2E-4799修补程序修复了requisition_lists GraphQL查询返回不正确的total_count值的问题,该值仅反映当前页面上的项目数,而不是与查询条件匹配的申请列表实体的总数。 安装Quality Patches Tool (QPT) 1.1.82时,此修补程序可用。 修补程序ID为ACP2E-4799。 请注意,此问题计划在Adobe Commerce B2B 1.5.4中修复。
受影响的产品和版本
为Adobe Commerce版本创建了修补程序:
- Adobe Commerce(所有部署方法)B2B 1.5.2-p4
与Adobe Commerce版本兼容:
- Adobe Commerce(所有部署方法)B2B >=1.5.0 <1.5.3
NOTE
该修补程序可能适用于具有新Quality Patches Tool发行版本的其他版本。 要检查修补程序是否与您的Adobe Commerce版本兼容,请将
magento/quality-patches包更新到最新版本,并在Quality Patches Tool:搜索修补程序页面上检查兼容性。 使用修补程序ID作为搜索关键字来查找修补程序。问题
当客户查询分页的申请列表时,total_count字段未反映匹配申请列表的全数。 相反,它仅报告为当前页面返回的项目数,这会使分页元数据不准确。
先决条件:
已为Adobe Commerce B2B启用申请列表。
重现步骤:
-
在“管理员”中,转到Stores > 设置 > 配置。
-
在左侧面板的 常规 下,选择B2B功能。
-
将 Enable Requisition List 设置为 Yes 并选择Save Config。
-
以客户身份登录店面。
-
选择 My Requisition Lists 并创建六个申请列表。
-
确保客户只有六个申请列表,并且每个列表名称都包含
ABC,因此所有六个列表都与筛选的查询匹配。 -
运行以下GraphQL查询,
pageSize设置为2,currentPage设置为1:code language-graphql query { customer { requisition_lists( pageSize: 2 currentPage: 1 ) { items { uid name } total_count page_info { current_page page_size total_pages } } } } -
运行此GraphQL查询:
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 } } } }
预期的结果:
requisition_lists查询返回的total_count等于客户拥有的申请列表总数,独立于pageSize和currentPage。- 分页数据与完全匹配结果集保持一致。
实际结果:
total_count只返回当前页面中的项目数,如两个而不是六个。
应用修补程序
要应用单独的修补程序,请根据您的部署方法使用以下链接:
- Adobe Commerce或Magento Open Source内部部署: Quality Patches Tool指南中的Quality Patches Tool >使用情况
- 云基础架构上的Adobe Commerce: Commerce on Cloud Infrastructure指南中的升级和修补程序>应用修补程序
相关阅读
要了解有关Quality Patches Tool的更多信息,请参阅:
recommendation-more-help
commerce-operations-help-tools