From 43a023575ad931e33d596513e47365c5d50f715f Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Wed, 30 Mar 2016 10:15:49 +0300 Subject: [PATCH] Fix. warning about using NULL as first argument in `foreach`. Problem now in `tepmplate.php` ```PHP $menu_array = $menu->menu_array(); ... foreach ($menu_array as $index_main => $menu_parent) { ``` It appear while install process because in this moment there not `$db` and `$menu->menu_array()` returns nothing. This problem also can be solved in `tepmplate.php` like ```PHP if(is_array($menu_array)){ foreach ($menu_array as $index_main => $menu_parent) { ... ``` --- resources/classes/menu.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/classes/menu.php b/resources/classes/menu.php index 7a0adfb6d1..656580b207 100644 --- a/resources/classes/menu.php +++ b/resources/classes/menu.php @@ -390,7 +390,7 @@ $db = $this->db; //database ojbect does not exist return immediately - if (!$db) { return; } + if (!$db) { return Array(); } //if there are no groups then set the public group if (!isset($_SESSION['groups'])) { @@ -435,6 +435,7 @@ //save the menu into an array $x = 0; + $a = Array(); foreach($result as $row) { //add the row to the array $a[$x] = $row;