Question

Upon opening a product page i get 404.

In exceptions log i see this error:

exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`fromae`.`report_event`, CONSTRAINT `FK_REPORT_EVENT_EVENT_TYPE_ID_REPORT_EVENT_TYPES_EVENT_TYPE_ID` FOREIGN KEY (`event_type_id`) REFERENCES `report_event_types` (`event_type_id`) ON DELETE C)' in /var/www/html/lib/Zend/Db/Statement/Pdo.php:228

I opened the database and saw that report_event_types tables is empty and this produces the exception. Should it be like this? Why is it empty? And how would i fix this?

UPD I fixed it by adding necessary data into the report_event_types table.

Was it helpful?

Solution

I have run with the same issue and after digging found the following solution.

Please try to check your database table "report_event_types" if it is empty please use following:

INSERT INTO `report_event_types` (`event_type_id`, `event_name`, `customer_login`) VALUES
(1, 'catalog_product_view', 0),
(2, 'sendfriend_product', 0),
(3, 'catalog_product_compare_add_product', 0),
(4, 'checkout_cart_add_product', 0),
(5, 'wishlist_add_product', 0),
(6, 'wishlist_share', 0);

My problem is resolved with this.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top