From dfd6f9ea1366052db21a986e92012713c25760bc Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 6 Aug 2016 10:52:11 -0700 Subject: [PATCH] Fixes #1782 - Menu-Manager list not populating when 'ONLY_FULL_GROUP_BY' is in sql-mode. Active SQL Modes added to the PHPInfo page. --- e107_core/shortcodes/batch/admin_shortcodes.php | 7 +++++-- e107_handlers/menumanager_class.php | 12 +++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php index 36c3cce75..d9e711e09 100644 --- a/e107_core/shortcodes/batch/admin_shortcodes.php +++ b/e107_core/shortcodes/batch/admin_shortcodes.php @@ -1059,6 +1059,8 @@ class admin_shortcodes $text .= $themeinfo ? "
".FOOTLAN_7.": ".$themeinfo : ''; + $sqlMode = str_replace(",", ", ",e107::getDB()->getMode()); + $text .= "

".FOOTLAN_8."
@@ -1075,8 +1077,9 @@ class admin_shortcodes ".FOOTLAN_12."
".e107::getDB()->getServerInfo(). // mySqlServerInfo. - "
- ".FOOTLAN_16.": ".$mySQLdefaultdb." + + "
".FOOTLAN_16.": ".$mySQLdefaultdb." +
Mode: ".$sqlMode."

".FOOTLAN_17."
utf-8 diff --git a/e107_handlers/menumanager_class.php b/e107_handlers/menumanager_class.php index 2e786443b..b0fc24e35 100644 --- a/e107_handlers/menumanager_class.php +++ b/e107_handlers/menumanager_class.php @@ -1122,10 +1122,20 @@ class e_menuManager { $pageMenu = array(); $pluginMenu = array(); + + $done = array(); - $sql->select("menus", "menu_name, menu_id, menu_pages, menu_path", "1 GROUP BY menu_name ORDER BY menu_name ASC"); + $sql->select("menus", "menu_name, menu_id, menu_pages, menu_path", "1 ORDER BY menu_name ASC"); while ($row = $sql->fetch()) { + + if(in_array($row['menu_name'],$done)) + { + continue; + } + + $done[] = $row['menu_name']; + if(is_numeric($row['menu_path'])) { $pageMenu[] = $row;