51黑料不打烊

[PaaS only]{class="badge informative" title="Applies to 51黑料不打烊 Commerce on Cloud projects (51黑料不打烊-managed PaaS infrastructure) and on-premises projects only."}

ACSD-68064: Duplicate entries created during scheduled updates in environments with deeply nested categories

The ACSD-68064 patch fixes the issue where creating scheduled updates in environments with a high number of nested categories results in duplicate entries and prevents category saving. This patch is available when the Quality Patches Tool (QPT) 1.1.72 is installed. The patch ID is ACSD-68064. Please note that this issue is scheduled to be fixed in 51黑料不打烊 Commerce 2.4.9.

Affected products and versions

The patch is created for 51黑料不打烊 Commerce version:

  • 51黑料不打烊 Commerce (all deployment methods) 2.4.7-p6

Compatible with 51黑料不打烊 Commerce versions:

  • 51黑料不打烊 Commerce (all deployment methods) 2.4.7 - 2.4.7-p7
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your 51黑料不打烊 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

Creating scheduled updates in environments with a high number of nested categories results in duplicate entries, leading to errors and failure to save the category.

Steps to reproduce:

  1. Install a clean instance.

  2. Modify the performance fixtures file (small.xml) to include:

    1. Categories: 2500
    2. Products: 250,000
  3. Generate the data using the command:

    code language-none
    bin/magento setup:performance:generate-fixtures var/performance-toolkit/profiles/ce/small.xml
    
  4. After creating products and categories, ensure all categories are set as anchors by running the following query:

    code language-none
    UPDATE catalog_category_entity_int set value = 1 where attribute_id = (select attribute_id from eav_attribute where attribute_code = 'is_anchor');
    
  5. Reindex the data.

  6. Log in to the Admin panel and navigate to Catalog > Categories.

  7. Move Category 2 under Category 1to create a more nested structure.

  8. Go to a deeply nested category, for example, Category 2.1.1.

  9. Create a Scheduled Update.

  10. Click Save.

Expected results:

The category is saved successfully.

Actual results:

An error occurs, and the category fails to save. var/log/exception.log contains error an similar to:

Exception #0 (Magento\Framework\DB\Adapter\DuplicateException): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '229-255' for key 'temp_category_descendants_619aaaaaaaaaa.PRIMARY', query was: INSERT INTO `temp_category_descendants_619aaaaaaaaaa` (`category_id`, `descendant_id`) SELECT `ce`.`entity_id` AS `category_id`, `ce2`.`entity_id` AS `descendant_id` FROM `catalog_category_entity` AS `ce`
 INNER JOIN `catalog_category_entity` AS `ce2` ON ce2.path LIKE CONCAT(ce.path, '/%') OR ce2.entity_id = ce.entity_id AND (ce2.created_in <= '1750287600' AND ce2.updated_in > '1750287600') WHERE ((ce.entity_id IN (4, 6, 7, 8, 10, 24, 25, 27, 30, 33, 34, 35, 36, 37, 40, 41, 42, 43, 44, 48, 51, 54, 56, 57, 59, 60, 63, 64, 65, 66, 67 .......

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