Abbeywood Posted February 17, 2015 Share Posted February 17, 2015 Hello, I started using Prestashop 2 weeks ago and I am finding it easy work with. I added a few categories and it was ok. I started products, now I have about 30 products. But at the moment when I attempt to create a new category I receive this error: [PrestaShopException]Id must be filled for categories treeat line 97 in file classes/helper/HelperForm.php 92. { 93. case 'categories': 94. if ($categories) 95. { 96. if (!isset($params['tree']['id'])) 97. throw new PrestaShopException('Id must be filled for categories tree'); 98. 99. $tree = new HelperTreeCategories($params['tree']['id'], isset($params['tree']['title']) ? $params['tree']['title'] : null); 100. 101. if (isset($params['name'])) 102. $tree->setInputName($params['name']); I searched the internet I found that I can comment this 96/97 lines, which makes it ok but it is still very disordered. Could you tell me what the problem might be and how it can be fixed? Thanks in advance. 1 Link to comment Share on other sites More sharing options...
michal.horen Posted February 20, 2015 Share Posted February 20, 2015 Hi, I have the same problem - when I try to edit categories I get this exception. Any help? Thank you! Michal Link to comment Share on other sites More sharing options...
Lola Guillen Posted March 2, 2015 Share Posted March 2, 2015 Hola, tengo el mismo problema, por favor necesito ayuda. Gracias, Lola. Link to comment Share on other sites More sharing options...
GeorgeVE Posted April 17, 2015 Share Posted April 17, 2015 Hello,any news about this error? Link to comment Share on other sites More sharing options...
Pete78 Posted April 17, 2015 Share Posted April 17, 2015 Had this error as well... here is what helped me (I upgraded from a 1.5.6er version) Check if you have an "override" of AdminCategoriesController.php in /override/controllers/admin/ if yes, please look into this file and search for a "renderForm" method. If this method exits, you are propably using an outdated module. The code in 1.6 changed a bit and the form generation is a little bit different. Make sure you find this: array( 'type' => 'categories', 'label' => $this->l('Parent category'), 'name' => 'id_parent', 'tree' => array( 'id' => 'categories-tree', 'selected_categories' => $selected_categories, 'disabled_categories' => (!Tools::isSubmit('add'.$this->table) && !Tools::isSubmit('submitAdd'.$this->table)) ? array($this->_category->id) : null ) ), and not this: array( 'type' => 'categories', 'label' => $this->l('Parent category:'), 'name' => 'id_parent', 'values' => array( 'trads' => array( 'Root' => $root_category, 'selected' => $this->l('Selected'), 'Collapse All' => $this->l('Collapse All'), 'Expand All' => $this->l('Expand All') ), 'selected_cat' => $selected_cat, 'input_name' => 'id_parent', 'use_radio' => true, 'use_search' => false, 'disabled_categories' => array(4), 'top_category' => Category::getTopCategory(), 'use_context' => true, ) ), Hope this helps ... 2 Link to comment Share on other sites More sharing options...
GeorgeVE Posted April 25, 2015 Share Posted April 25, 2015 (edited) array( 'type' => 'categories', 'label' => $this->l('Parent category:'), 'name' => 'id_parent', 'values' => array( 'trads' => array( 'Root' => $root_category, 'selected' => $this->l('selected'), 'Collapse All' => $this->l('Collapse All'), 'Expand All' => $this->l('Expand All') ), 'selected_cat' => $selected_cat, 'input_name' => 'id_parent', 'use_radio' => TRUE, 'use_search' => FALSE, 'disabled_categories' => array(4), 'top_category' => Category::getTopCategory(), 'use_context' => TRUE, ) ), Hello,this is what i have. But look after delete the dolibarr module (unistall) my backend was unaccesible,(did an full restore with my isp hosting)i think it also that some module that does it do,but donn't know wich one. Can i do anything else? Thank you Edited April 25, 2015 by GeorgeVE (see edit history) Link to comment Share on other sites More sharing options...
Pete78 Posted April 25, 2015 Share Posted April 25, 2015 You don't have to delete the module. Just replace the code you found with array( 'type' => 'categories', 'label' => $this->l('Parent category'), 'name' => 'id_parent', 'tree' => array( 'id' => 'categories-tree', 'selected_categories' => $selected_categories, 'disabled_categories' => (!Tools::isSubmit('add'.$this->table) && !Tools::isSubmit('submitAdd'.$this->table)) ? array($this->_category->id) : null ) ), Link to comment Share on other sites More sharing options...
GeorgeVE Posted April 28, 2015 Share Posted April 28, 2015 Hello, Can you provide me where to begin? or give me the full code,so i can copy paste it Thank you Link to comment Share on other sites More sharing options...
Pete78 Posted April 28, 2015 Share Posted April 28, 2015 Hi As I wrote: Replace the code you posted in post #6 with the code I posted in #7 Thats's it Cheers Link to comment Share on other sites More sharing options...
sergiool Posted June 18, 2015 Share Posted June 18, 2015 (edited) I have the same problem.Using Version 1.6.0.14The code you mention do not enecuentro in HelperForm.php file.You can tell me the line number where the replacement of code posted in # 7 should be done? Regards Reread all again and I realized I was looking in the wrong file.Segui's intruciocnes of Pete78 and the problem was solved, however, the presentation of the interface does not look good. Then that's what I will review.Thanks for the help. Edited June 18, 2015 by sergiool (see edit history) Link to comment Share on other sites More sharing options...
globalgt Posted August 28, 2015 Share Posted August 28, 2015 I had the same problem. using prestashop 1.6.1.1 and the default shop front all was ok, modified the shop front still all ok, then I bought a shop front from prestacrea and had this issue contacted there help and they said it was a presta problem and not theirs, odd that i never had it until I used their shop front. Followed the instructions above and it worked so thank you to Pete78 My only add on is make sure you follow the path he tells you in post number 5 as there is another folder admin/controllers/ and you need the folder /override/controllers/admin/AdminCategoriesController.php Link to comment Share on other sites More sharing options...
greeftdc Posted December 1, 2015 Share Posted December 1, 2015 Thank you Pete78, it worked for me. Link to comment Share on other sites More sharing options...
brave Posted April 27, 2017 Share Posted April 27, 2017 Thanks Pete78 !! I had the same problem and your code could fix it Link to comment Share on other sites More sharing options...
Luisejo Posted February 27, 2018 Share Posted February 27, 2018 Hi guys! I have a possible solution for this issue. If you can read in Spanish: http://luisjordan.net/blog/prestashop/error-id-must-be-filled-for-categories-tree-prestashop/ If is impossible for you understand the Spanish language, you may contact to me by private message. Best regards. 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