joa_pen Posted February 17, 2014 Share Posted February 17, 2014 (edited) Hello, I have upgraded to Prestashop 1.5.6 and I'm having a weird behavior of the categories. I have a tree of categories, with a specified parent category for each child.Something very simple, nothing special. home Sport Music Rock Pop Computers Now, When I edit one of them and I save it, the category lose the parent category and go up to the root level. For instance, I edit "pop", save it and the result of the tree is: home Sport Music Rock Computers Pop Now, when I edit the category on the root (in this case "pop") I cannot assign a parent category. Had someone this behavior? Do you know the reason? What should I do to fix it? Many thanks in advance, Edited February 18, 2014 by joa_pen (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted February 18, 2014 Share Posted February 18, 2014 Now, When I edit one of them and I save it, the category lose the parent category and go up to the root level. For instance, I edit "pop", save it and the result of the tree is: while edit option to mark category as root is unchecked? 1 Link to comment Share on other sites More sharing options...
joa_pen Posted February 18, 2014 Author Share Posted February 18, 2014 Hello Vekia, I think you have pointed to the issue, I have reviewed the category form, and the field "root category" is not shown. It should be between the field "Parent Category" and the field description, but it is not there, Why this field is not being show? How can enable it? Many thanks in advance Link to comment Share on other sites More sharing options...
caravntrader Posted March 5, 2014 Share Posted March 5, 2014 Hello, i have the same problem while editing my categories, they " jump" after saving, one level higher and become home categories. the problem is, home categories can´t be assigned to a parent category! @ joa_pen : Do you solve that Problem? Regards Link to comment Share on other sites More sharing options...
ang3lx Posted March 12, 2014 Share Posted March 12, 2014 me too! parent category lost when make changes Link to comment Share on other sites More sharing options...
caravntrader Posted March 17, 2014 Share Posted March 17, 2014 me too! parent category lost when make changes wish prestashop version? Link to comment Share on other sites More sharing options...
joa_pen Posted March 17, 2014 Author Share Posted March 17, 2014 I updated to version Prestashop 1.5.6. I performed some actions: 1.- I was able to identify the entries that had the issue. I did review the database level and nothing weird there. 2.- I createed new categories with the same names and replace the wrong categories by new ones. This worked, in conjunction with point #3 3.- I uninstalled the category module, and then installed it again. Now it works. Link to comment Share on other sites More sharing options...
caravntrader Posted March 17, 2014 Share Posted March 17, 2014 I had the same Problem too after upgrading to 1.5.6. did you think about redirect your old url-categories? Link to comment Share on other sites More sharing options...
joa_pen Posted March 17, 2014 Author Share Posted March 17, 2014 No I didn't, it was not required for me. Link to comment Share on other sites More sharing options...
caravntrader Posted March 17, 2014 Share Posted March 17, 2014 i see, for me was no way to delete them. My shop is still online! so i downgraded my prestashop version. Maybe it will better with 1.6! Regards Link to comment Share on other sites More sharing options...
joa_pen Posted March 17, 2014 Author Share Posted March 17, 2014 have you tried to un-install and install again the category module? Link to comment Share on other sites More sharing options...
caravntrader Posted March 17, 2014 Share Posted March 17, 2014 yes i did. Link to comment Share on other sites More sharing options...
k.kannegieter Posted March 17, 2014 Share Posted March 17, 2014 Are you speaking about the module Block_categories? Link to comment Share on other sites More sharing options...
joa_pen Posted March 17, 2014 Author Share Posted March 17, 2014 yes, that one. Link to comment Share on other sites More sharing options...
k.kannegieter Posted March 17, 2014 Share Posted March 17, 2014 Sadly this does not solve the issue for me. Any other suggestions apart from downgrading?When i edit a category it still places it in root and parent becomes uneditable through the admin panel.Due to the amount of categories we have its not prefered to edit everything in PHPmyAdmin. Link to comment Share on other sites More sharing options...
k.kannegieter Posted March 17, 2014 Share Posted March 17, 2014 while edit option to mark category as root is unchecked? I dont have an option to mark as root. At least its not visible. Link to comment Share on other sites More sharing options...
stottycabanas Posted March 18, 2014 Share Posted March 18, 2014 The ability to define a category as a root category disappeared in version 1.5.5.0 onwards. My guess is that you have upgraded to a more recent version from a pre-1.5.5.0 version where you had defined some categories as root categories. Then, when you try & amend a category in the more recent version, PS can't recognise your previous category structure, so makes it into an 'orphan' category. As I said, this is a guess! Now, When I edit one of them and I save it, the category lose the parent category and go up to the root level. For instance, I edit "pop", save it and the result of the tree is: home Sport Music Rock Computers Pop joa_pen, to test my theory, can I ask whether you had Sport, Music & Computers defined as root categories before your upgrade? Thanks, Dave Link to comment Share on other sites More sharing options...
k.kannegieter Posted March 18, 2014 Share Posted March 18, 2014 The ability to define a category as a root category disappeared in version 1.5.5.0 onwards. My guess is that you have upgraded to a more recent version from a pre-1.5.5.0 version where you had defined some categories as root categories. Then, when you try & amend a category in the more recent version, PS can't recognise your previous category structure, so makes it into an 'orphan' category. As I said, this is a guess! joa_pen, to test my theory, can I ask whether you had Sport, Music & Computers defined as root categories before your upgrade? Thanks, Dave Dave, Do you think that if i would change the root settings manually in database it would fix the problem? Link to comment Share on other sites More sharing options...
stottycabanas Posted March 18, 2014 Share Posted March 18, 2014 Dave, Do you think that if i would change the root settings manually in database it would fix the problem? It would be worth a try, but make sure to take a backup of your database before you do it, and test it thoroughly afterwards. I believe the category structure is defined via a combination of the category id, the parent category, whether it's a root category and the vales of nleft and nright. My concern is that if you change categories from being root to non-root (leaving only Home as a root category) and update parent categories if needed, the values in nleft and nright may still mean that your category structure doesn't have integrity. NB confusingly, there is a hidden category called root (with id_category = 1) which is NOT set as a root category. Do not adjust that or the Home category. The safest option, although pretty tedious in the short term, is to spend some time reinputting the categories and deleting the existing ones as joa_pen did. It may save you time in the long run. Cheers, Dave Link to comment Share on other sites More sharing options...
stottycabanas Posted March 18, 2014 Share Posted March 18, 2014 Having just seen this post http://www.prestashop.com/forums/topic/315556-categories-gone-asap-help/?p=1598208 you may be able to get the structure rebuilt by adding a new category, so rekeying may not be necessary after all. Anyway, as I said, test thoroughly! Cheers, Dave Link to comment Share on other sites More sharing options...
k.kannegieter Posted March 18, 2014 Share Posted March 18, 2014 Reinputting 700 categories, descriptions and all is not really an option sadly. Link to comment Share on other sites More sharing options...
stottycabanas Posted March 18, 2014 Share Posted March 18, 2014 OK understood. As I said, I think that may not be necessary. Cheers, Dave Link to comment Share on other sites More sharing options...
caravntrader Posted March 19, 2014 Share Posted March 19, 2014 I solve it by changing the id-parent value on the ps_category. I assigned all the parrent category to the root "id_parent=1" after that i deleted the empty"new appeared" home category on the same table. Link to comment Share on other sites More sharing options...
stottycabanas Posted March 20, 2014 Share Posted March 20, 2014 I solve it by changing the id-parent value on the ps_category. I assigned all the parrent category to the root "id_parent=1" after that i deleted the empty"new appeared" home category on the same table. I hope that continues to work for you, but it might have been safer to replicate the default PS structure. This has the (hidden) category 'root' with id_category = 1 which is the parent of 'Home' which has id_category = 2 and then have the other categories as children of Home. Cheers, Dave Link to comment Share on other sites More sharing options...
joa_pen Posted March 20, 2014 Author Share Posted March 20, 2014 @stottycabanas, I did not try your theory in the way you mentioned, but I review the mySQL table to ensure that the field defines an entry as "root category". @k.kannegieter If you change the root settings manually in database, it will fix the problem temporally. The issue will come when you edit again the entry or some of the childs. Did you try to remove the "Block_categories" module, and then install again? Link to comment Share on other sites More sharing options...
k.kannegieter Posted March 20, 2014 Share Posted March 20, 2014 Someone should add a script that automatically rebuilds the category structure. I just updated to 1.6.0.5 and the issue still persists.I wonder if someone is able to do such a thing? Because i dont think we're the only ones with these issues. Link to comment Share on other sites More sharing options...
k.kannegieter Posted March 20, 2014 Share Posted March 20, 2014 Also adding a new category, does not restructure the old categories. SO this does not fix the issue. Newly created categories how so ever act as they should. Link to comment Share on other sites More sharing options...
joa_pen Posted May 16, 2014 Author Share Posted May 16, 2014 After some months, the root cause of this issue seems to be still there. We have changed a couple of category titles from the store and the issue came back: the category missed the link to the parent category and now is under the root category. Link to comment Share on other sites More sharing options...
Recommended Posts