Check to see if the menu tree contains any items in the array.
1 unresolved thread
Merge request reports
Activity
149 151 ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'], 150 152 ]; 151 153 $tree = $this->menuTree->transform($tree, $manipulators); 154 152 155 if (empty($tree)) { 153 156 return $build; 154 157 } 158 155 159 $build = $this->menuTree->build($tree); 156 array_walk($build['#items'], [static::class, 'removeNoLinkItem']); 157 array_walk($build['#items'], [static::class, 'unlinkActiveItem'], $active_link); 160 161 if (array_key_exists('items', $build)) { Hi @stephen.geinosky,
array_key_exists
does not seem to guarantee that$build['#items']
is not null (cf. https://www.php.net/manual/en/function.array-key-exists.php).Wouldn't
isset()
be a better choice here?changed this line in version 2 of the diff
added 1 commit
- 79e49055 - Check to see if the array exists. The array key could provide a null value,...
Please register or sign in to reply