ÃÛ¶¹ÊÓÆµ

[PaaS only]{class="badge informative" title="Applies to ÃÛ¶¹ÊÓÆµ Commerce on Cloud projects (ÃÛ¶¹ÊÓÆµ-managed PaaS infrastructure) and on-premises projects only."}

ACSD-66311: Companies grid loads slowly for restricted admin users

The ACSD-66311 patch fixes the issue where the companies grid loads slowly for admin users with restricted website access. This patch is available when the Quality Patches Tool (QPT) 1.1.69 is installed. The patch ID is ACSD-66311. Please note that this issue is scheduled to be fixed in ÃÛ¶¹ÊÓÆµ Commerce 2.4.9.

Affected products and versions

The patch is created for ÃÛ¶¹ÊÓÆµ Commerce version:

  • ÃÛ¶¹ÊÓÆµ Commerce (all deployment methods) 2.4.7-p4

Compatible with ÃÛ¶¹ÊÓÆµ Commerce versions:

  • ÃÛ¶¹ÊÓÆµ Commerce (all deployment methods) 2.4.7-p4 - 2.4.8-p1
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your ÃÛ¶¹ÊÓÆµ 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

Companies grid loads slowly for admin users with restricted website access.

Steps to reproduce:

  1. Install ÃÛ¶¹ÊÓÆµ Commerce with B2B features.

  2. Create 2 extra websites (in addition to Main website) with stores/views:

    • Main Website (created during installation)
    • Website 2 → Store 2 → StoreView 2
    • Website 3 → Store 3 → StoreView 3
  3. Create the Admins in Scope user role:

    • Scope: only two stores: Main Website + Website 3/Store 3.
    • Resources: only Dashboard + Companies.
  4. Create an admin user with a role Admins in Scope, for example, adminscope.

  5. Generate specific distributed customer and company data:

    1. Customers assigned to websites

      table 0-row-2 1-row-2 2-row-2 3-row-2
      Website ID Number of customers
      1 600,000
      2 1,500
      3 500
    2. Run the following query to verify the distribution:

      code language-none
           SELECT website_id, COUNT(*)
           FROM customer_entity
           GROUP BY website_id;
      
    3. Customers assigned to companies

      table 0-row-2 1-row-2 2-row-2 3-row-2
      Number of customers Number of companies
      1 4,500
      2 ~1,000
      ~595k 1
    4. Run the following query to verify the distribution:

      code language-none
            SELECT customer_count, COUNT(*) AS number_of_companies
            FROM (
              SELECT company_id, COUNT(customer_id) AS customer_count
              FROM company_advanced_customer_entity
              GROUP BY company_id
            ) AS subquery
            GROUP BY customer_count
            ORDER BY customer_count;
      
  6. Reindex all data to generate entries in the customer_grid_flat.

  7. Log in as adminscope.

  8. Go to Customers > Companies.

Expected results:

The page loads in under 1 second.

Actual results:

The page takes more than 14 minutes to load.

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
c2d96e17-5179-455c-ad3a-e1697bb4e8c3