From 0d456a3081bb59537add6f51803b2df7534db2ae Mon Sep 17 00:00:00 2001 From: Georgios Papadakis Date: Tue, 16 Aug 2016 12:26:06 +0300 Subject: [PATCH 1/3] Remove unused left join in getOptions for menuparent form element --- .../components/com_menus/models/fields/menuparent.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/administrator/components/com_menus/models/fields/menuparent.php b/administrator/components/com_menus/models/fields/menuparent.php index 13a94eefce7f1..370240c1b1570 100644 --- a/administrator/components/com_menus/models/fields/menuparent.php +++ b/administrator/components/com_menus/models/fields/menuparent.php @@ -40,8 +40,7 @@ protected function getOptions() $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.id AS value, a.title AS text, a.level') - ->from('#__menu AS a') - ->join('LEFT', $db->quoteName('#__menu') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt'); + ->from('#__menu AS a'); // Filter by menu type. if ($menuType = $this->form->getValue('menutype')) From 8754f1024f43c4f7047fad85cd7876a91f0870e0 Mon Sep 17 00:00:00 2001 From: Georgios Papadakis Date: Tue, 16 Aug 2016 14:00:13 +0300 Subject: [PATCH 2/3] Replaced unneeded group by with distinct --- .../components/com_menus/models/fields/menuparent.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/administrator/components/com_menus/models/fields/menuparent.php b/administrator/components/com_menus/models/fields/menuparent.php index 370240c1b1570..2ec1f8e9db542 100644 --- a/administrator/components/com_menus/models/fields/menuparent.php +++ b/administrator/components/com_menus/models/fields/menuparent.php @@ -39,7 +39,7 @@ protected function getOptions() $db = JFactory::getDbo(); $query = $db->getQuery(true) - ->select('a.id AS value, a.title AS text, a.level') + ->select('DISTINCT(a.id) AS value, a.title AS text, a.level') ->from('#__menu AS a'); // Filter by menu type. @@ -68,7 +68,6 @@ protected function getOptions() } $query->where('a.published != -2') - ->group('a.id, a.title, a.level, a.lft, a.rgt, a.menutype, a.parent_id, a.published') ->order('a.lft ASC'); // Get the options. From 2972851a1c8f95436f57294722ed2790b8f3e547 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Wed, 17 Aug 2016 21:37:43 +0200 Subject: [PATCH 3/3] fix #11628 for postgresql (#2) in postgresql don't work as it is now , it give an **SQL ERROR** for the `ORDER BY` clause field used `a.lft` must be in the select list of fields when the `SELECT` use `DISTINCT()` --- administrator/components/com_menus/models/fields/menuparent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_menus/models/fields/menuparent.php b/administrator/components/com_menus/models/fields/menuparent.php index 2ec1f8e9db542..cb665c34e41f6 100644 --- a/administrator/components/com_menus/models/fields/menuparent.php +++ b/administrator/components/com_menus/models/fields/menuparent.php @@ -39,7 +39,7 @@ protected function getOptions() $db = JFactory::getDbo(); $query = $db->getQuery(true) - ->select('DISTINCT(a.id) AS value, a.title AS text, a.level') + ->select('DISTINCT(a.id) AS value, a.title AS text, a.level, a.lft') ->from('#__menu AS a'); // Filter by menu type.