Jump to content

[Solved] Product error- An error occurred while creating object


Recommended Posts

I'm trying to duplicate a product and I'm getting an error messege-

 

1 error

  1. An error occurred while creating object.

 

I tried to do it with and without the image and get the same thing.

 

I just tried to create a new product, and I'm getting the same messege.

 

The only thing I've done is I populated the site with items using the csv import

 

I'm using PrestaShop™ 1.4.9.0

 

 

Any ideas I can look at to figure this out would be a great help.

 

Dan

Link to comment
Share on other sites

I didn't mention, my uploading items through the CSV works fine and I can edit and modify products. I turned on the debug but get no additional messege. In another post someone mentioned they had the same thing and it was a database error. I can export my database and look through it. What should I look for?

Link to comment
Share on other sites

Fixed it.

 

When I was setting up my dtatabase I was moving my ebay items in and I used ebays item as a product id on a couple things, which can't be done.

 

I had to export all the tables that had them. Each number I replaced with a new smaller number for each instance, I then deleted the instance of them from the database

 

DELETE FROM `ps_category_product` WHERE id_product IN (####);

DELETE FROM `ps_product` WHERE id_product IN (####);

DELETE FROM `ps_product_lang` WHERE id_product IN (####);

DELETE FROM `ps_attribute_impact` WHERE id_product IN (####);

DELETE FROM `ps_product_download` WHERE id_product IN (####);

DELETE FROM `ps_product_sale` WHERE id_product IN (####);

DELETE FROM `ps_product_tag` WHERE id_product IN (####);

DELETE FROM `ps_scene_products` WHERE id_product IN (####);

DELETE FROM `ps_search_index` WHERE id_product IN (####);

DELETE FROM `ps_stock_mvt` WHERE id_product IN (####);

DELETE FROM `ps_accessory` WHERE id_product_1 IN (####);

DELETE FROM `ps_accessory` WHERE id_product_2 = (####);

DELETE FROM `ps_product_attachment` WHERE id_product IN (#####);

DELETE FROM `ps_feature_product` WHERE id_product IN (####);

DELETE FROM `ps_customization_field` WHERE id_product IN (####);

DELETE FROM `ps_specific_price` WHERE id_product IN (####);

DELETE FROM `ps_product_attribute` WHERE id_product IN (####);

DELETE FROM `ps_image` WHERE id_product IN (####);

DELETE FROM `ps_image_lang` WHERE id_image IN (####);

 

I also did a search of the numbers in the database and removed any indexed.

 

I then inserted them back with their new product numbers and the big thing I also had to do was reset the auto increment in ps_product, I can now duplicate and create new items

  • Like 1
Link to comment
Share on other sites

Fixed it. When I was setting up my dtatabase I was moving my ebay items in and I used ebays item as a product id on a couple things, which can't be done. I had to export all the tables that had them. Each number I replaced with a new smaller number for each instance, I then deleted the instance of them from the database DELETE FROM `ps_category_product` WHERE id_product IN (####); DELETE FROM `ps_product` WHERE id_product IN (####); DELETE FROM `ps_product_lang` WHERE id_product IN (####); DELETE FROM `ps_attribute_impact` WHERE id_product IN (####); DELETE FROM `ps_product_download` WHERE id_product IN (####); DELETE FROM `ps_product_sale` WHERE id_product IN (####); DELETE FROM `ps_product_tag` WHERE id_product IN (####); DELETE FROM `ps_scene_products` WHERE id_product IN (####); DELETE FROM `ps_search_index` WHERE id_product IN (####); DELETE FROM `ps_stock_mvt` WHERE id_product IN (####); DELETE FROM `ps_accessory` WHERE id_product_1 IN (####); DELETE FROM `ps_accessory` WHERE id_product_2 = (####); DELETE FROM `ps_product_attachment` WHERE id_product IN (#####); DELETE FROM `ps_feature_product` WHERE id_product IN (####); DELETE FROM `ps_customization_field` WHERE id_product IN (####); DELETE FROM `ps_specific_price` WHERE id_product IN (####); DELETE FROM `ps_product_attribute` WHERE id_product IN (####); DELETE FROM `ps_image` WHERE id_product IN (####); DELETE FROM `ps_image_lang` WHERE id_image IN (####); I also did a search of the numbers in the database and removed any indexed. I then inserted them back with their new product numbers and the big thing I also had to do was reset the auto increment in ps_product, I can now duplicate and create new items

 

 

Can you make this more clearer, I am having the same problem but I do not know where to start.

Link to comment
Share on other sites

Once you remove all instances of the item with the long id, you need to search the database for that number and make sure it's gone, it maybe indexed. remove those too. Then reset the autoincrement. if you don't have many just add the product through the backoffice to see if it works. if not you may have another problem too.

 

I found the reset auto increment through operations didn't work, I then used a query

alter table abc auto_increment = 1;

 

it won't reset to 1 but to the highest product number that is there, change table 'abc' to what your product table is

Dan

Edited by kashyyyk (see edit history)
Link to comment
Share on other sites

What if I just want to delete all the products I added that cause this error message. I log in phpmyAdmin and change all the product ID to a lower ID number and instead the products disappear off my website but I was still getting the error message.

 

I am willing to add the products manually, so how can I remove these products

Link to comment
Share on other sites

DELETE FROM `ps_category_product` WHERE id_product IN (####);

DELETE FROM `ps_product` WHERE id_product IN (####);

DELETE FROM `ps_product_lang` WHERE id_product IN (####);

DELETE FROM `ps_attribute_impact` WHERE id_product IN (####);

DELETE FROM `ps_product_download` WHERE id_product IN (####);

DELETE FROM `ps_product_sale` WHERE id_product IN (####);

DELETE FROM `ps_product_tag` WHERE id_product IN (####);

DELETE FROM `ps_scene_products` WHERE id_product IN (####);

DELETE FROM `ps_search_index` WHERE id_product IN (####);

DELETE FROM `ps_stock_mvt` WHERE id_product IN (####);

DELETE FROM `ps_accessory` WHERE id_product_1 IN (####);

DELETE FROM `ps_accessory` WHERE id_product_2 = (####);

DELETE FROM `ps_product_attachment` WHERE id_product IN (#####);

DELETE FROM `ps_feature_product` WHERE id_product IN (####);

DELETE FROM `ps_customization_field` WHERE id_product IN (####);

DELETE FROM `ps_specific_price` WHERE id_product IN (####);

DELETE FROM `ps_product_attribute` WHERE id_product IN (####);

DELETE FROM `ps_image` WHERE id_product IN (####);

DELETE FROM `ps_image_lang` WHERE id_image IN (####);

 

this is through mysql like phpMyAdmin not through the back office, also do a backup first, put your product id where #### is. you may get an error for a table, it may just mean the product wasn't in that table. then use the search in mysql for the product ids and see if they are gone. then use the auto increment like above

  • Like 1
Link to comment
Share on other sites

  • 2 years later...

DELETE FROM `ps_category_product` WHERE id_product IN (####);
DELETE FROM `ps_product` WHERE id_product IN (####);
DELETE FROM `ps_product_lang` WHERE id_product IN (####);
DELETE FROM `ps_attribute_impact` WHERE id_product IN (####);
DELETE FROM `ps_product_download` WHERE id_product IN (####);
DELETE FROM `ps_product_sale` WHERE id_product IN (####);
DELETE FROM `ps_product_tag` WHERE id_product IN (####);
DELETE FROM `ps_scene_products` WHERE id_product IN (####);
DELETE FROM `ps_search_index` WHERE id_product IN (####);
DELETE FROM `ps_stock_mvt` WHERE id_product IN (####);
DELETE FROM `ps_accessory` WHERE id_product_1 IN (####);
DELETE FROM `ps_accessory` WHERE id_product_2 = (####);
DELETE FROM `ps_product_attachment` WHERE id_product IN (#####);
DELETE FROM `ps_feature_product` WHERE id_product IN (####);
DELETE FROM `ps_customization_field` WHERE id_product IN (####);
DELETE FROM `ps_specific_price` WHERE id_product IN (####);
DELETE FROM `ps_product_attribute` WHERE id_product IN (####);
DELETE FROM `ps_image` WHERE id_product IN (####);
DELETE FROM `ps_image_lang` WHERE id_image IN (####);



I am also facing the same problem with the product duplicaton and creation.
Kindly help me i am so worried about that.

I dn't understand how you fix this issue.
kindly more elaborate this.
Regards & advance thanks.
 

Link to comment
Share on other sites

  • 2 months later...
×
×
  • Create New...