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启用申请列表。

重现步骤

  1. 在“管理员”中,转到​Stores > 设置 > 配置

  2. 在左侧面板的​ 常规 ​下,选择​B2B功能

  3. 将​ Enable Requisition List ​设置为​ Yes ​并选择​Save Config

  4. 以客户身份登录店面。

  5. 选择​ My Requisition Lists ​并创建六个申请列表。

  6. 确保客户只有六个申请列表,并且每个列表名称都包含ABC,因此所有六个列表都与筛选的查询匹配。

  7. 运行以下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
          }
        }
      }
    }
    
  8. 运行此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等于客户拥有的申请列表总数,独立于pageSizecurrentPage
  • 分页数据与完全匹配结果集保持一致。

实际结果

total_count只返回当前页面中的项目数,如两个而不是六个。

应用修补程序

要应用单独的修补程序,请根据您的部署方法使用以下链接:

相关阅读

要了解有关Quality Patches Tool的更多信息,请参阅:

recommendation-more-help
commerce-operations-help-tools