KamranMK Posted September 23, 2013 Share Posted September 23, 2013 This is getting ridiculuous. I have a fresh install of prestashop and have transfered database from my old website which ran presta 1.5.2 Right now I am having issues, whenever i try to update a product it throws me this error An error occurred while updating an object. product () And in reality depending on what i update the update goes through, so for example if I update the quantity of aproduct it does update but when i try to update the specific price then i get this error I have tried this fix which i found on the forum but it did not work, alter table ps_product add column redirect_type int (10) ;alter table ps_product_shop add column redirect_type int (10) ; Is this something problematic with presta 1.5.5? I hope somebody can help fix this Link to comment Share on other sites More sharing options...
El Patron Posted September 23, 2013 Share Posted September 23, 2013 see this post http://www.prestashop.com/forums/topic/213276-an-error-occurred-while-creating-object-product-solved/?do=findComment&comment=1052722 you will need access to your db with phpmyadmin or something similar that allows you to run mysql commands Link to comment Share on other sites More sharing options...
KamranMK Posted September 23, 2013 Author Share Posted September 23, 2013 see this post http://www.prestashop.com/forums/topic/213276-an-error-occurred-while-creating-object-product-solved/?do=findComment&comment=1052722 you will need access to your db with phpmyadmin or something similar that allows you to run mysql commands El Patron, I have used a bit different code from the one there, and now it says that SQL query: ALTER TABLE prs_product_shop ADD `redirect_type` ENUM( '', '404', '301', '302' ) NOT NULL DEFAULT '' AFTER `active` ; MySQL said: #1060 - Duplicate column name 'redirect_type' What should i do in this case? how can i drop the table and do the query again? Link to comment Share on other sites More sharing options...
KamranMK Posted September 23, 2013 Author Share Posted September 23, 2013 see this post http://www.prestashop.com/forums/topic/213276-an-error-occurred-while-creating-object-product-solved/?do=findComment&comment=1052722 you will need access to your db with phpmyadmin or something similar that allows you to run mysql commands I dropped the column and tried the code again but no luck It is still showing that mistake Is that a bug within prestashop 1.5.5 or what is it? I can't understand Would really appreciate if you could help fix it Link to comment Share on other sites More sharing options...
El Patron Posted September 23, 2013 Share Posted September 23, 2013 it is difficult via a forum to see what you have done...what needs to be done etc. i.e. not sure I can help much more than i have using forum... I am not sure why you used a different command than the two documented in the 'solved' thread.... the method of importing the 1.5.2 database into a new version, well leaves you open for this sort of problem, i.e. db fields not matching.. Link to comment Share on other sites More sharing options...
KamranMK Posted September 23, 2013 Author Share Posted September 23, 2013 it is difficult via a forum to see what you have done...what needs to be done etc. i.e. not sure I can help much more than i have using forum... I am not sure why you used a different command than the two documented in the 'solved' thread.... the method of importing the 1.5.2 database into a new version, well leaves you open for this sort of problem, i.e. db fields not matching.. The thing is that I have used the code that was documented in the thread and it still did not help since in that thread there is one more person that has the same issue thus this leaves to me believe that there is something else wrong and I hope we can find it Link to comment Share on other sites More sharing options...
El Patron Posted September 23, 2013 Share Posted September 23, 2013 probably the easiest way for your to proceed is to create a clean ps installation of same version. then you can compare the tables...and find the differences... Link to comment Share on other sites More sharing options...
KamranMK Posted September 23, 2013 Author Share Posted September 23, 2013 probably the easiest way for your to proceed is to create a clean ps installation of same version. then you can compare the tables...and find the differences... This is actually a good idea, but then, since I am not that good in understanding the databases do you think it would best to post it here on the forum to find some hlp? Link to comment Share on other sites More sharing options...
El Patron Posted September 23, 2013 Share Posted September 23, 2013 This is actually a good idea, but then, since I am not that good in understanding the databases do you think it would best to post it here on the forum to find some hlp? give it a try first...make sure to also build your sitemap and submit to google... Link to comment Share on other sites More sharing options...
KamranMK Posted September 23, 2013 Author Share Posted September 23, 2013 give it a try first...make sure to also build your sitemap and submit to google... El Patron, thanks for the idea. I actually found the issue So in the fresh install there is a column called id_product_redirected which i did not have in my db from version 1.5.2 So with my no skills in MySQL i was able to sort of figure out that this should be the query to the database but i need help in defining 0 for this column what changes do i need to make to the query in order to achieve that maybe somebody can help ALTER TABLE prs_product_shop ADD `id_product_redirected` ENUM('', '404', '301', '302') NOT NULL DEFAULT '' AFTER `redirect_type` ; ALTER TABLE prs_product ADD `id_product_redirected` ENUM('', '404', '301', '302') NOT NULL DEFAULT '' AFTER `redirect_type` ; here it assigns those values (404,301,302) to the column but i need to have just plain 0 Link to comment Share on other sites More sharing options...
El Patron Posted September 23, 2013 Share Posted September 23, 2013 good job following up on this and reporting back how you resolved...the community thanks you. I will mark as solved Link to comment Share on other sites More sharing options...
KamranMK Posted September 23, 2013 Author Share Posted September 23, 2013 good job following up on this and reporting back how you resolved...the community thanks you. I will mark as solved Thank you as well, this solution works, but just to be perfectionist i was not able to find the way to make that column become 0 due to my limited mysql knowledge ) Link to comment Share on other sites More sharing options...
KamranMK Posted September 23, 2013 Author Share Posted September 23, 2013 Thank you as well, this solution works, but just to be perfectionist i was not able to find the way to make that column become 0 due to my limited mysql knowledge ) Here is the Final Code to fully fix this issue ALTER TABLE prs_product_shop ADD `id_product_redirected` INT( 0 ) NOT NULL AFTER `redirect_type` ; ALTER TABLE prs_product ADD `id_product_redirected` INT( 0 ) NOT NULL AFTER `redirect_type` ; 1 Link to comment Share on other sites More sharing options...
Fins Posted November 14, 2013 Share Posted November 14, 2013 I had the same error after upgrading 1.4.8 to 1.5.6, but it was caused by Unknown column 'id_color_default' in 'field list'. Made a database change in PHPMyAdmin with: ALTER TABLE `ps_product` ADD `id_color_default` INT(10) NULL DEFAULT NULL AFTER `id_category_default`; and the system now adds new products and edits existing ones. Added to thread just in case it helps somebody. 1 Link to comment Share on other sites More sharing options...
doar-aloe Posted April 13, 2015 Share Posted April 13, 2015 Hello! I have the same error when I try to modify the products status, the description. My currently version of prestashop is 1.6.0.14. If I use this code on the PHPmyAdmin: ALTER TABLE ps_product_shop ADD `id_product_redirected` INT( 0 ) NOT NULL AFTER `redirect_type` ; ALTER TABLE ps_product ADD `id_product_redirected` INT( 0 ) NOT NULL AFTER `redirect_type` ; I received: ErrorSQL query: ALTER TABLE ps_product_shop ADD `id_product_redirected` INT( 0 ) NOT NULL AFTER `redirect_type` ; #1060 - Duplicate column name 'id_product_redirected' What I'm doing wrong? Could some explain how this database works? Link to comment Share on other sites More sharing options...
lovemyseo Posted March 9, 2017 Share Posted March 9, 2017 see this post http://www.prestashop.com/forums/topic/213276-an-error-occurred-while-creating-object-product-solved/?do=findComment&comment=1052722 you will need access to your db with phpmyadmin or something similar that allows you to run mysql commands But I got this error on multi-shop page An error occurred while updating an object. cms () on cms pages multi-shop prestashop 1.6.1.11 any ideas? Link to comment Share on other sites More sharing options...
Recommended Posts