diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 04c342e33..3ff3544ab 100755 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -3934,7 +3934,7 @@ class e_admin_controller_ui extends e_admin_controller $keys = array(); foreach($matches[1] AS $k=>$v) { - if(varset($matches[3][$k])) + if(varset($matches[3][$k]) && !array_key_exists($v, $this->joinAlias)) { $this->joinAlias[$v] = $matches[3][$k]; // array. eg $this->joinAlias['core_media'] = 'm'; } diff --git a/e107_handlers/model_class.php b/e107_handlers/model_class.php index e7157ac6d..346f325ac 100755 --- a/e107_handlers/model_class.php +++ b/e107_handlers/model_class.php @@ -3456,10 +3456,7 @@ class e_tree_model extends e_front_model $rowParentID = (int) $row[$sort_parent]; // Note: This optimization only works if the SQL query executed was ordered by the sort parent. - if($nodeID !== $rowParentID) - { - break; - } + if($rowParentID > $nodeID) break; $node['_children'][] = &$row; unset($rows[$key]); @@ -3620,7 +3617,7 @@ class e_tree_model extends e_front_model return ""; }, $db_query) // Optimization goes with e_tree_model::moveRowsToTreeNodes() - . " ORDER BY " . $this->getParam('sort_parent'); + . " ORDER BY " . $this->getParam('sort_parent') . "," . $this->getParam('primary_field'); $this->setParam('db_query', $db_query); } diff --git a/e107_plugins/forum/forum_class.php b/e107_plugins/forum/forum_class.php index 14ee26b94..6bc73b2bc 100644 --- a/e107_plugins/forum/forum_class.php +++ b/e107_plugins/forum/forum_class.php @@ -2430,8 +2430,6 @@ class e107forum public function upgradeLegacyPrefs() { - e107::getMessage()->addDebug("Legacy Forum Menu Pref Detected. Upgrading.."); - $legacyMenuPrefs = array( 'newforumposts_caption' => 'caption', 'newforumposts_display' => 'display', @@ -2445,11 +2443,11 @@ class e107forum { if(e107::getMenu()->setParms('forum','newforumposts_menu', $newPrefs) !== false) { - e107::getMessage()->addDebug("Sucessfully Migrated newforumposts prefs from core to menu table. "); + e107::getMessage()->addDebug("Successfully migrated newforumposts prefs from core to menu table."); } else { - e107::getMessage()->addDebug("Legacy Forum Menu Pref Detected. Upgrading.."); + e107::getMessage()->addDebug("Legacy Forum menu pref detected. Upgrading..."); } }