You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Possibly, both of them can be marked as deprecated as Mage_Catalog_Model_Resource_Category_Indexer_Product_refreshRootRelations ends with FK_CAT_CTGR_PRD_IDX_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID exception due try to insert category_id 0 as given in fresh installed core_store_group.store_id join and the Mage_Catalog_Model_Resource_ProductrefreshIndex function breaks on non existing $categoryObject->refreshProductIndex($indexCategoryIds, $indexProductIds); call.
Summary (*)
There are a lot references in code to
catalog_category_product_index
action likecatalogProductSave
orcatalogProductMassAction
which seem to be obsolete as they are no longer called anywhere https://github.com/OpenMage/magento-lts/blob/main/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php or in https://github.com/OpenMage/magento-lts/blob/main/app/code/core/Mage/Catalog/Model/Resource/Product.php#L300refreshIndex
method.Possibly, both of them can be marked as deprecated as
Mage_Catalog_Model_Resource_Category_Indexer_Product
_refreshRootRelations
ends with FK_CAT_CTGR_PRD_IDX_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID exception due try to insertcategory_id
0 as given in fresh installedcore_store_group
.store_id
join and theMage_Catalog_Model_Resource_Product
refreshIndex
function breaks on non existing$categoryObject->refreshProductIndex($indexCategoryIds, $indexProductIds);
call.Examples (*)
Call
Mage::getResourceModel('catalog/category_indexer_product')->catalogProductMassAction($event);
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`catalog_category_product_index`, CONSTRAINT `FK_CAT_CTGR_PRD_IDX_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`category_id`)
or
Mage::getResourceModel('catalog/product')->refreshIndex($product);
Call to undefined method Mage_Catalog_Model_Resource_Category::refreshProductIndex()
Proposed solution
refreshProductIndex
method should be added toMage_Catalog_Model_Resource_Category
classinsertFromSelect
method should be removed from https://github.com/OpenMage/magento-lts/blob/main/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php#L739_refreshRootRelations
function.catalogProductMassAction
andrefreshIndex
should be marked as deprecated.The text was updated successfully, but these errors were encountered: