[僅限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