Jump to content

Error: Id must be filled for categories tree


Recommended Posts

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 tree
at 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.

Link to comment
Share on other sites

please try this.. its not the best solution but i believe that works...

 

$params['tree']['id'] ='categories-tree'; // code added

 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);

 

let me know...

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...