cancel
Showing results for 
Search instead for 
Did you mean: 

Create new Product Error Integrity constraint violation: 1452

Create new Product Error Integrity constraint violation: 1452

Hi all,

I have problem with creating new product in magento 1.9.1.0. The error is:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`usrdb_carhnase`.`catalog_product_entity_varchar`, CONSTRAINT `FK_CAT_PRD_ENTT_VCHR_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON), query was: INSERT INTO `catalog_product_entity_varchar` (`entity_type_id`,`attribute_id`,`store_id`,`value`) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`)

 

I wonder why entity_id is missing in insert-query

Error: SQL: INSERT INTO `catalog_product_entity_varchar` (`entity_type_id`,`attribute_id`,`store_id`,`value`) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`)

 

Btw, the correct insert-query should be:

INSERT INTO `catalog_product_entity_varchar` (`entity_type_id`, `attribute_id`, `store_id`, `entity_id`, `value`)

 

any suggest, ideas or discussions are appreciated. Thx

 

 

 

1 REPLY 1

Re: Create new Product Error Integrity constraint violation: 1452

ok, the problem was cause by custom modules. It's solved.