Tobias Posted March 5, 2010 Share Posted March 5, 2010 Hi!I have encountered as the title said: an error occurred while creating object product when i try to add a new product in backoffice.Its possible to add new categories but not new product, im also Not able to duplicate products? Been reading around here, and found no good answers unfortunatly appreciate all help, can also offer a small amount if a working solution is found. Also tried all kinds of different product names so this cant be the matter.Please do get back if you can offer some kind of help, getting desperate here!Thanks Link to comment Share on other sites More sharing options...
Tobias Posted March 5, 2010 Author Share Posted March 5, 2010 someone with a little knowledge please? Link to comment Share on other sites More sharing options...
Tobias Posted March 6, 2010 Author Share Posted March 6, 2010 daily bump and well.... as i said before i can offer a small amount if someone can give me a solution to it! Really need to get it working asap. 1 Link to comment Share on other sites More sharing options...
rocky Posted March 6, 2010 Share Posted March 6, 2010 What version of PHP are you using? There are certain versions that cause problems in Prestashop. Link to comment Share on other sites More sharing options...
Tobias Posted March 9, 2010 Author Share Posted March 9, 2010 Thnx for the reply, problem solved. It was ps_product and ps_product_lang tables that didnt match wich caused the problem. Manually corrected all entries then everything works fine. Link to comment Share on other sites More sharing options...
JJBYPC Posted March 14, 2010 Share Posted March 14, 2010 Thnx for the reply, problem solved. It was ps_product and ps_product_lang tables that didnt match wich caused the problem. Manually corrected all entries then everything works fine. Hi Tobias,Could you please explain to me what you did to solve this problem?Please.Thanks Link to comment Share on other sites More sharing options...
ihackpro Posted April 21, 2010 Share Posted April 21, 2010 Thnx for the reply, problem solved. It was ps_product and ps_product_lang tables that didnt match wich caused the problem. Manually corrected all entries then everything works fine. Hi Tobias,Could you please explain to me what you did to solve this problem?Please.Thanks Yes please.I have a similar problem.I uploaded the shop to my hosting and I cannot duplicate items.But I could duplicate them working "locally"...Any help is welcome.Thanks Link to comment Share on other sites More sharing options...
Geunix Posted April 21, 2010 Share Posted April 21, 2010 Hi,this is not solved. At least not clear. what is ps_product and ps_product_lang?Thanks for the help! Link to comment Share on other sites More sharing options...
ihackpro Posted April 21, 2010 Share Posted April 21, 2010 Hi,this is not solved. At least not clear. what is ps_product and ps_product_lang?Thanks for the help! Hey,they are some tables from the database! Link to comment Share on other sites More sharing options...
armadillo Posted April 24, 2010 Share Posted April 24, 2010 Hi, what we have to do with these tables to solve the problem.Thanks Link to comment Share on other sites More sharing options...
brandonc503 Posted April 24, 2010 Share Posted April 24, 2010 yea im having same issue. i was able to jsut refresh page and start item entry again, but does not seem to work now. what changes did you make to those tables to make them match? Link to comment Share on other sites More sharing options...
shopgirl Posted June 12, 2010 Share Posted June 12, 2010 I'm having this issue too. Version 1.3.1. Link to comment Share on other sites More sharing options...
brandonc503 Posted June 15, 2010 Share Posted June 15, 2010 ive moved on to using 1.3.1 but realy dont remember this problem. sorry. Link to comment Share on other sites More sharing options...
brandonc503 Posted June 15, 2010 Share Posted June 15, 2010 oh yea. i remember, product entry.. yea happens with 1.3.1 also sometimes. i just refresh the page or go back into catalog and create again and it works fine. havent had time to track down issue. Link to comment Share on other sites More sharing options...
shopgirl Posted June 15, 2010 Share Posted June 15, 2010 I'm not having trouble creating a new product from scratch. The problem is with using that "duplicate" little green button. All the time. Would be nice to be able to use. Link to comment Share on other sites More sharing options...
mageberg Posted June 21, 2010 Share Posted June 21, 2010 Hi, I have the same problem as Tobias described at the beginning. I have 67 products in various categories and I can't add new product or duplicate it (I can add categories for instance). I get the same error: "Error occurred while creating object product". I use prestashop v.1.2.2 and I wonder if the update into 1.3.1 would solve the problem. As shopgirl wrote above the problem still exists, even in 1.3.1 So, I don't know what to do. Tobias suggests to fix the problem with 'product' and 'product_lang' tables. I don't know what is the problem with these tables and what is more I wonder if this fix solves the problem for good or not. If the fix has to be repeated from time to time because the relation between tables is spoiled by certain operation in the shop, such solution is useless. Does somebody know where is the problem and how to solve it ?Thanks in advance. Link to comment Share on other sites More sharing options...
shopgirl Posted June 21, 2010 Share Posted June 21, 2010 Someone knowlegeable said it is because of our MySQL version being too low. Mine is below 5.2 like he said. So if I want the duplication ability, I would need to upgrade it. Link to comment Share on other sites More sharing options...
mageberg Posted June 22, 2010 Share Posted June 22, 2010 From prestashop page:-------------------------------------------System requirements: * - Linux, Unix, or Windows * - Web Server (Apache 1.3 or later, IIS 6 or later) * - PHP 5.0* or later * - MySQL 5** or later** PrestaShop is working from MySQL 4.1.14 to 5.0 too but some features are not working (e.g., product duplication) or have strange behaviors------------------------------------------I use MySQL 5.0.9. In my case there is also problem with common adding new products to the category not only with duplication. Moreover, the duplication and creating new product have worked till now and has stopped to work suddenly. Link to comment Share on other sites More sharing options...
mageberg Posted June 22, 2010 Share Posted June 22, 2010 I've found following changes in CHANGELOG between 1.2.2 and 1.3.1 Classes : Fixed bug #2988 - Added several methods in order to better clean the DB while deleting a productBO : fixed bug duplicating product with image (#2862)Classes : fixed bug while duplicating product without tags (#2860). Thanks to Victor Berchet !That's interesting what problems could happen wihtout these correction. Maybe badly performed duplication hasn't copied all relations correctly what has caused my problem. Has somebody met similar problem ?shopgirl, thanks for quick and useful response! Maybe it's really problem with database and mysql 5.0 isn't good enough and we really need to use 5.2 (it would mean mistake on http://www.prestashop.com/en/downloads). It's a next issue to check. Link to comment Share on other sites More sharing options...
mysterion Posted July 9, 2010 Share Posted July 9, 2010 I've the same error duplicating products with v1.3.1.1 and MYSQL 5.0.77 Is there no solution? Why is thread marked "solved"? Link to comment Share on other sites More sharing options...
rocky Posted July 9, 2010 Share Posted July 9, 2010 The thread is marked solved because there was a known issue in product image duplication that was fixed in the latest version of PrestaShop. Unfortunately, that won't work for you, since you are using MySQL 5.0, which has known product duplication problems. You should upgrade to a newer version of MySQL. Link to comment Share on other sites More sharing options...
mysterion Posted July 12, 2010 Share Posted July 12, 2010 Can anyone recommend a european based host that does support this functionality in Prestashop? Link to comment Share on other sites More sharing options...
maestrobo Posted September 3, 2010 Share Posted September 3, 2010 It seems it is an issue with MYSQL 4.1. Because Prestashop was developed with MYSQL 5 in mind, you have to hack the code to make it work.Basically, the problem comes from a MYSQL QUERY which does not work on MYSQL 4.1. Basically the INSERT query includes a variable which refers to a SELECT QUERY. In my opinion, MYSQL 4.1 does not support such queries which make Prestashop pretty unstable on MYSQL 4.xx versions.Maybe there are some other queries to correct to make it work correctly on every MYSQL version.It is in the file Classes/Category.phpYou have to modify the code of the function duplicateProductCategories.To make it work, replace the function duplicateProductCategories with this code: public static function duplicateProductCategories($id_old, $id_new) { $result = Db::getInstance()->ExecuteS(' SELECT `id_category` FROM `'._DB_PREFIX_.'category_product` WHERE `id_product` = '.intval($id_old)); $row = array(); if ($result) foreach ($result AS $i){ $data = '(SELECT (tmp.max + 1) AS newpos FROM (SELECT MAX(cp.`position`) AS max FROM `'._DB_PREFIX_.'category_product` cp WHERE cp.`id_category`='.intval($i['id_category']).') AS tmp)'; $result = Db::getInstance()->getRow($data); $maxpos = $result['newpos']; $row[] = '('.implode(', ', array(intval($id_new), $i['id_category'], $maxpos)).')'; } $flag = Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'category_product` (`id_product`, `id_category`, `position`) VALUES '.implode(',', $row)); return $flag; } At least, it works for me! Duplicate product is operational!Please report if that hack works for you. Link to comment Share on other sites More sharing options...
mysterion Posted September 3, 2010 Share Posted September 3, 2010 Nice work Maestrobo! Thanks for sharing. Link to comment Share on other sites More sharing options...
maestrobo Posted October 2, 2010 Share Posted October 2, 2010 Bug is still present in latest 1.3.2 despite the fact that it is said to be fixed.Change the function as previously indicated and that should work again for those using MYSQL 4.1 server. Link to comment Share on other sites More sharing options...
armadillo Posted January 10, 2011 Share Posted January 10, 2011 Thank you very much it worked for me Link to comment Share on other sites More sharing options...
webmasterdevil Posted June 24, 2014 Share Posted June 24, 2014 Hi,I resolve this error by enabling dev mode on config/defines.inc.php:define('_PS_MODE_DEV_', true);After this I discover that my problem was the field date_add from table categories that is required.Remove the requirement from DB table, and everything works fine.Hope it helps Link to comment Share on other sites More sharing options...
Umar Akram Posted January 16, 2015 Share Posted January 16, 2015 I am also facing the same issue cant create the duplicate the product.when i am going to create the procut then i am getting this message. "An error occurred while creating an object."Any help please. Link to comment Share on other sites More sharing options...
Recommended Posts