Magento Forum

   
Foreign key constraint problem after upgrade to 1.7.0.2
 
Deicist
Jr. Member
 
Total Posts:  2
Joined:  2012-03-19
 

Hi,

I recently upgraded from 1.6.1 to 1.7.2 and am hitting some problems with a custom module.

The module uses the following method to associate simple products to configurable products:

Mage::getResourceModel(’catalog/product_type_configurable’)->saveProducts( $product, $simpleSkus );

$simpleSkus is an array of simple product skus
$product is my configurable product.

this method is throwing the following error:

Error in associate SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`magentocms`.`catalog_product_super_link`, CONSTRAINT `FK_CAT_PRD_SPR_LNK_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CA)

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top