cancel
Showing results for 
Search instead for 
Did you mean: 

Error upon deleting a product

Error upon deleting a product

Hi

 

I am contacting you because I am having issues to delete products from Magento (we use Magento EE 1.9). For some products (not all) I am getting this message:

 

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`20160105_prod_thetops`.`tts_brand_product`, CONSTRAINT `fk_brand_product_product` FOREIGN KEY (`product_id`) REFERENCES `tts_catalog_product_entity` (`entity_id`) ON DELETE NO ACTION ON UPDAT), query was: DELETE FROM `tts_catalog_product_entity` WHERE (entity_id=45532)

 
I have absolutely no access or knowledge to the source code - I am using it as a basic client.
 
Many thanks for your help,
Tags (3)
4 REPLIES

Re: Error upon deleting a product

Hi @mctops

 

seems that you have some 3rd party extension installed for managing brands. This extension created an additional table in your database and set very restrictive foreign key constraint, that disallows deleting the product if it has some brand assigned.

 

I can just guess how this extension works, but what you can do is to set empty manufacturer for the product prior to deleting it. It is very likely that this extension provides a non standard way of matching products with brands, on the admin level it may be some grid of products that are connected with the brand or something similar. Anyway, the point is to disconnect the product from the assigned brand and then re-try to delete it.

 

Cheers,

BX 

Re: Error upon deleting a product

Hello,

Thank you so much for replying and suggesting this solution.

Indeed there is a module that handles brands that I have never used before in my previous working place (still on magento) - hence I am guessing this is a custom module but cannot find its configuration settings in Admin for now. I have tried deleting the manufacturer and then the products related to that manufacturer (left vacant) but got the following message:

 

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`20160105_prod_thetops`.`tts_collection_product`, CONSTRAINT `fk_collection_product_product` FOREIGN KEY (`product_id`) REFERENCES `tts_catalog_product_entity` (`entity_id`) ON DELETE NO ACTIO), query was: DELETE FROM `tts_catalog_product_entity` WHERE (entity_id=49)

 

The fact that it mentions « collection » makes me wonder if this  not related to the collection tab which is in the custom module aside from fabricant.

 

However, when I try to delete collections; I get redirected to the following url: Mywebsite/index.php/admin.thetops/manage/massdelete/key/326eb4dc51ecbe8cc0ee304f925d8ace/  

 

Which gives me a blank page and nothing happens (no deletion). Im confused the url contains « mass delete » when I am only selecting one collection?

 

Again, thanks for trying to help me out, its very helpful to have someone with more expertise give me his advice.

Marion

Re: Error upon deleting a product

Edit: my apologies, I had sent you my reply via email but I only noticed today that it wasn't posted so copied/paste it manually instead.

 

Thanks,

Marion

Re: Error upon deleting a product

Hello,

 

Anyone has other suggestions by any chance?

 

Thanks a lot

Marion