[仅限PaaS]{class="badge informative" title="仅适用于云项目(Adobe管理的PaaS基础架构)和内部部署项目上的Adobe Commerce 。"}
ACSD-68064:在具有深度嵌套类别的环境中进行计划更新期间创建的重复条目
ACSD-68064修补程序修复了在具有大量嵌套类别的环境中创建计划更新会导致重复条目并阻止类别保存的问题。 安装Quality Patches Tool (QPT) 1.1.72时,此修补程序可用。 修补程序ID为ACSD-68064。 请注意,此问题计划在Adobe Commerce 2.4.9中修复。
受影响的产品和版本
为Adobe Commerce版本创建了修补程序:
- Adobe Commerce(所有部署方法) 2.4.7-p6
与Adobe Commerce版本兼容:
- Adobe Commerce(所有部署方法) 2.4.7 - 2.4.7-p7
NOTE
该修补程序可能适用于具有新Quality Patches Tool发行版本的其他版本。 要检查修补程序是否与您的Adobe Commerce版本兼容,请将
magento/quality-patches包更新到最新版本,并在Quality Patches Tool:搜索修补程序页面上检查兼容性。 使用修补程序ID作为搜索关键字来查找修补程序。问题
如果在具有大量嵌套类别的环境中创建计划更新,会导致重复条目,从而导致错误和无法保存类别。
重现步骤:
-
安装干净的实例。
-
修改性能夹具文件(small.xml)以包括:
- Categories: 2500
- Products: 250,000
-
使用命令生成数据:
code language-none bin/magento setup:performance:generate-fixtures var/performance-toolkit/profiles/ce/small.xml -
创建产品和类别后,请通过运行以下查询确保所有类别均设置为锚点:
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'); -
重新索引数据。
-
登录到“管理员”面板,然后导航到Catalog > Categories。
-
将 类别2 移动到 类别1 下以创建更嵌套的结构。
-
转到深度嵌套的类别,例如类别2.1.1。
-
创建一个Scheduled Update。
-
单击Save。
预期的结果:
已成功保存类别。
实际结果:
出现错误,无法保存类别。 var/log/exception.log包含错误,类似于:
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 .......
应用修补程序
要应用单独的修补程序,请根据您的部署方法使用以下链接:
- Adobe Commerce或Magento Open Source内部部署: Quality Patches Tool 指南中的>使用情况Quality Patches Tool。
- 云基础架构上的Adobe Commerce:云基础架构上的Commerce指南中的升级和修补程序>应用修补程序。
相关阅读
要了解有关Quality Patches Tool的更多信息,请参阅:
recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3