Jump to content

Data value must be an traversable array at line 150 in file classes/tree/Tree.php


Abdillokra

Recommended Posts

Hello Guys,

 

I have the folowing exception and I can't find anywhere in the forum the fix for it.

 

It pops up when I try to open the products page in the Back office (I can't access the products page only).

 

Can please any one point to the solution?

 

[PrestaShopException]

Data value must be an traversable array
at line 150 in file classes/tree/Tree.php

145. }
146.
147. public function setDataSearch($value)
148. {
149. if (!is_array($value) && !$value instanceof Traversable) {
150. throw new PrestaShopException('Data value must be an traversable array');
151. }
152.
153. $this->_data_search = $value;
154. return $this;
155. }
  • TreeCore->setDataSearch - [line 125 - classes/helper/HelperTreeCategories.php] - [1 Arguments]
    120. if (!empty($children)) {
    121. $tree[$root_category]['children'] = $children;
    122. }
    123.
    124. $this->setData($tree);
    125. $this->setDataSearch(Category::getAllCategoriesName($root_category, $lang, false, null, $this->useShopRestriction()));
    126. }
    127. }
    128.
    129. return $this->_data;
    130. }
  • HelperTreeCategoriesCore->getData - [line 311 - classes/helper/HelperTreeCategories.php]
    306. }
    307.
    308. public function render($data = null)
    309. {
    310. if (!isset($data)) {
    311. $data = $this->getData();
    312. }
    313.
    314. if (isset($this->_disabled_categories)
    315. && !empty($this->_disabled_categories)) {
    316. $this->_disableCategories($data, $this->getDisabledCategories());
  • HelperTreeCategoriesCore->render - [line 2506 - controllers/admin/AdminProductsController.php]
    2501. $tree->setAttribute('is_category_filter', (bool)$this->id_current_category)
    2502. ->setAttribute('base_url', preg_replace('#&id_category=[0-9]*#', '', self::$currentIndex).'&token='.$this->token)
    2503. ->setInputName('id-category')
    2504. ->setRootCategory(Category::getRootCategory()->id)
    2505. ->setSelectedCategories(array((int)$id_category));
    2506. $this->tpl_list_vars['category_tree'] = $tree->render();
    2507.
    2508. // used to build the new url when changing category
    2509. $this->tpl_list_vars['base_url'] = preg_replace('#&id_category=[0-9]*#', '', self::$currentIndex).'&token='.$this->token;
    2510. }
    2511. // @todo module free
  • AdminProductsControllerCore->initContent - [line 189 - classes/controller/Controller.php]
    184. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
    185. $this->initHeader();
    186. }
    187.
    188. if ($this->viewAccess()) {
    189. $this->initContent();
    190. } else {
    191. $this->errors[] = Tools::displayError('Access denied.');
    192. }
    193.
    194. if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className))) {
  • ControllerCore->run - [line 367 - classes/Dispatcher.php]
    362. if (isset($params_hook_action_dispatcher)) {
    363. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
    364. }
    365.
    366. // Running controller
    367. $controller->run();
    368. } catch (PrestaShopException $e) {
    369. $e->displayMessage();
    370. }
    371. }
    372.
  • DispatcherCore->dispatch - [line 58 - admin345/index.php]
    53. if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab'])) {
    54. $_REQUEST['controller'] = strtolower($_REQUEST['tab']);
    55. }
    56.
    57. // Prepare and trigger admin dispatcher
    58. Dispatcher::getInstance()->dispatch();
Edited by Abdillokra (see edit history)
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...