Ben90 Posted April 10, 2015 Share Posted April 10, 2015 (edited) Hi guys, I just wanna create a new subcategory, and then it coming like this: An error occurred while creating an object. category () Anybody knows what's happening? Prestashop 1.6.0.9 - Default Theme Edited April 10, 2015 by rukano (see edit history) Link to comment Share on other sites More sharing options...
Ben90 Posted April 10, 2015 Author Share Posted April 10, 2015 Any help would be appreciated... I did nothing and suddenly when I wanna create new category, this thing happens... Link to comment Share on other sites More sharing options...
Ben90 Posted April 10, 2015 Author Share Posted April 10, 2015 I can't even edit any categories 1 Link to comment Share on other sites More sharing options...
Ben90 Posted April 10, 2015 Author Share Posted April 10, 2015 Hello, is there anyone can help? Link to comment Share on other sites More sharing options...
Ben90 Posted April 11, 2015 Author Share Posted April 11, 2015 Is it really only me who encountered this kind of error? I search on the forum it happened before, but it's on product level, not category. No one can help? Link to comment Share on other sites More sharing options...
Ben90 Posted April 11, 2015 Author Share Posted April 11, 2015 Is there any particular native modules that I need to install because I don't think I installed any modules recently. I uninstalled some modules which are not used in the time being. I really have no idea what's the cause of this problem... Link to comment Share on other sites More sharing options...
JoelWebsites Posted April 11, 2015 Share Posted April 11, 2015 Hi you will need to click the add new category button on the top right hand side corner Link to comment Share on other sites More sharing options...
JoelWebsites Posted April 11, 2015 Share Posted April 11, 2015 ALTER TABLE product_shop ADD `redirect_type` ENUM('', '404', '301', '302') NOT NULL DEFAULT '' AFTER `active` ;ALTER TABLE product ADD `redirect_type` ENUM('', '404', '301', '302') NOT NULL DEFAULT '' AFTER `active` ; run these two statements in sql Link to comment Share on other sites More sharing options...
Ben90 Posted April 13, 2015 Author Share Posted April 13, 2015 (edited) Hi you will need to click the add new category button on the top right hand side corner I did but it still the same whether using the top right corner or using the other one. ALTER TABLE product_shop ADD `redirect_type` ENUM('', '404', '301', '302') NOT NULL DEFAULT '' AFTER `active` ; ALTER TABLE product ADD `redirect_type` ENUM('', '404', '301', '302') NOT NULL DEFAULT '' AFTER `active` ; run these two statements in sql Mind if I ask the purpose of these sql statement & what's actually happening? I just afraid if suddenly because of that it cause another problem. Thank you so much Edited April 13, 2015 by Ben90 (see edit history) Link to comment Share on other sites More sharing options...
JoelWebsites Posted April 13, 2015 Share Posted April 13, 2015 (edited) The statements will create a new colum called redirect type in the respective tables....I have never seen this type of error in a fresh install of prestashop..Can you try installing a fresh 1.6.0.14 version prestashop?? Edited April 13, 2015 by JoelWebsites (see edit history) Link to comment Share on other sites More sharing options...
Ben90 Posted April 13, 2015 Author Share Posted April 13, 2015 The statements will create a new colum called redirect type in the respective tables....I have never seen this type of error in a fresh install of prestashop..Can you try installing a fresh 1.6.0.14 version prestashop?? It's not fresh install, mate. So the website has been running for quite a long time with 1.6.0.9 and suddenly I can't create new categories or edit them. I'm afraid if I upgrade the version, it gonna create more problems like what happened before. Some months ago it's updated from 1.4 to 1.6 and a lot of work need to be done to fix the problem. That creation of column gonna fix this kind of error? Link to comment Share on other sites More sharing options...
JoelWebsites Posted April 13, 2015 Share Posted April 13, 2015 Yes please check if those redirect_type colums already exist if not create it with the above statments.. Link to comment Share on other sites More sharing options...
bellini13 Posted April 13, 2015 Share Posted April 13, 2015 An error occurred while creating an object. category () Is this the only message you receive? There is no more information that is included after category? Have you tried adding categories since you performed the upgrade from 1.4? Or is this the first time you are trying to do this since the upgrade? Link to comment Share on other sites More sharing options...
Ben90 Posted April 14, 2015 Author Share Posted April 14, 2015 Is this the only message you receive? There is no more information that is included after category? Have you tried adding categories since you performed the upgrade from 1.4? Or is this the first time you are trying to do this since the upgrade? Hi, thanks for replying. Yes. that's the only error message. It's been working well after like 4 months after upgrade. I've added some categories as well. I reckon i didn't install any modules this past month, only module upgrade. Suddenly I can't add or edit any categories Link to comment Share on other sites More sharing options...
bellini13 Posted April 14, 2015 Share Posted April 14, 2015 Hi, thanks for replying. Yes. that's the only error message. It's been working well after like 4 months after upgrade. I've added some categories as well. I reckon i didn't install any modules this past month, only module upgrade. Suddenly I can't add or edit any categories Things never stop working without something having changed. and i certainly cannot say what you did or did not do. If you don't if you changed something in the past month, then how would anyone else. Perhaps you should look at your modules folder and review the date/time of those folders and see if anything has changed Link to comment Share on other sites More sharing options...
Ben90 Posted April 15, 2015 Author Share Posted April 15, 2015 Things never stop working without something having changed. and i certainly cannot say what you did or did not do. If you don't if you changed something in the past month, then how would anyone else. Perhaps you should look at your modules folder and review the date/time of those folders and see if anything has changed The module updates are more like weekly. So, when I check it right now, almost all of them updated last Friday... Link to comment Share on other sites More sharing options...
Ben90 Posted April 15, 2015 Author Share Posted April 15, 2015 I just checked it the last time I can edit the categories. It was 23rd of March, last month. When I search it on phpmyadmin, it has duplicate entries on 1 id_category. The one before & after renamed. Is it normal? Please check this screen shot: Link to comment Share on other sites More sharing options...
Ben90 Posted April 15, 2015 Author Share Posted April 15, 2015 Yes please check if those redirect_type colums already exist if not create it with the above statments.. Hi Joel, I check it on phpmyadmin, the column is there already. This is the screen shot: Link to comment Share on other sites More sharing options...
JoelWebsites Posted April 15, 2015 Share Posted April 15, 2015 Please try this....Go to admin panel ..... Advance parameter performance >> here you will see disable all third party modules and disable all overrides ...select Yes here and try again.It may work. Also try put error reporting true on defines.inc.php in the config folder ....tell me if you get any errors..Thank you.. Link to comment Share on other sites More sharing options...
Ben90 Posted April 24, 2015 Author Share Posted April 24, 2015 Things never stop working without something having changed. and i certainly cannot say what you did or did not do. If you don't if you changed something in the past month, then how would anyone else. Perhaps you should look at your modules folder and review the date/time of those folders and see if anything has changed Please try this....Go to admin panel ..... Advance parameter performance >> here you will see disable all third party modules and disable all overrides ...select Yes here and try again.It may work. Also try put error reporting true on defines.inc.php in the config folder ....tell me if you get any errors..Thank you.. Hi guys, So I tried to enable dev mode, but couldn't see any error message on the homepage. And then I go to some pages with products, then finally I can see the error message in FO: Warning: preg_replace(): Compilation failed: invalid range in character class at offset 24 in /home/marblece/public_html/classes/Tools.php on line 1150 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 24 in /home/marblece/public_html/classes/Tools.php on line 1150 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 24 in /home/marblece/public_html/classes/Tools.php on line 1150 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 24 in /home/marblece/public_html/classes/Tools.php on line 1150 Anyway, I didn't disable all third party modules & overrides at the moment because I afraid when I re-enable them, more problems will appears. Let me check whether I can do the restore quickly if something happened & then I can disable all third party modules & overrides. Link to comment Share on other sites More sharing options...
Ben90 Posted April 24, 2015 Author Share Posted April 24, 2015 I found the solution for that one on forge.prestashop by adding \ before - $str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]\-\pL]/u', '', $str); else $str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]\-]/','', $str); But unfortunately that one didn't fixed the problem. Maybe that one is another things. When I enable dev mode & try to create a new category, this is what appears on BO on the top: Unknown column 'position' in 'field list' INSERT INTO `ps_category` (`nleft`, `nright`, `level_depth`, `active`, `id_parent`, `id_shop_default`, `is_root_category`, `position`, `date_add`, `date_upd`) VALUES ('0', '0', '2', '1', '1', '1', '0', '0', '2015-04-24 11:38:01', '2015-04-24 11:38:01') When I try to edit a category, this is what appears: Unknown column 'position' in 'field list' UPDATE `ps_category` SET `id_category` = '411',`nleft` = '555',`nright` = '562',`level_depth` = '2',`active` = '1',`id_parent` = '1',`id_shop_default` = '1',`is_root_category` = '0',`position` = '25',`date_add` = '2013-07-22 10:58:42',`date_upd` = '2015-04-24 11:33:45' WHERE `id_category` = 411 I still can't edit or create a new category Link to comment Share on other sites More sharing options...
JoelWebsites Posted April 24, 2015 Share Posted April 24, 2015 Please show me a screen short of your my sql category_lang table I want to see the values in it and also a screenshort of the categories table thank you. Link to comment Share on other sites More sharing options...
Ben90 Posted April 24, 2015 Author Share Posted April 24, 2015 Please show me a screen short of your my sql category_lang table I want to see the values in it and also a screenshort of the categories table thank you. category_lang category Link to comment Share on other sites More sharing options...
JoelWebsites Posted April 24, 2015 Share Posted April 24, 2015 (edited) I see that there is a weird column in your table the colum name is proslider..This is a non default prestashop column .This might be the cause of the issue...you might need to drop the column called proslider. Edited April 24, 2015 by JoelWebsites (see edit history) Link to comment Share on other sites More sharing options...
Ben90 Posted April 27, 2015 Author Share Posted April 27, 2015 I see that there is a weird column in your table the colum name is proslider..This is a non default prestashop column .This might be the cause of the issue...you might need to drop the column called proslider. I just realised something, mate. There is no column named "position" in ps_category. I check it on my localhost with original prestashop 1.6, there should be a column named "position" on number 10 inside "ps_category" table Link to comment Share on other sites More sharing options...
JoelWebsites Posted April 27, 2015 Share Posted April 27, 2015 (edited) I recommend you to make all the changes on the table such that it should match a new prestashop install ..remove the unwanted and add the wanted colums.This should solve the issue.And take backup before making the changes incase you are not sure..let us know if the issue is resolved. Edited April 27, 2015 by JoelWebsites (see edit history) 1 Link to comment Share on other sites More sharing options...
Ben90 Posted April 28, 2015 Author Share Posted April 28, 2015 I recommend you to make all the changes on the table such that it should match a new prestashop install ..remove the unwanted and add the wanted colums.This should solve the issue.And take backup before making the changes incase you are not sure..let us know if the issue is resolved. So this one solved the problem by adding position column which was missing: ALTER TABLE `ps_category` ADD `position` int(10) unsigned NOT NULL default '0' AFTER `date_upd`; Link to comment Share on other sites More sharing options...
JoelWebsites Posted April 28, 2015 Share Posted April 28, 2015 ok awesome please mark this thread as solved. Link to comment Share on other sites More sharing options...
Ben90 Posted April 30, 2015 Author Share Posted April 30, 2015 ok awesome please mark this thread as solved. I did, mate. As soon as it's solved. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now