1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-25 17:01:43 +02:00

Merge pull request #3210 from Deltik/fix-3198

Fixes #3198 - Legacy prefs, missing forums
This commit is contained in:
Cameron
2018-06-23 17:10:13 -07:00
committed by GitHub
3 changed files with 5 additions and 10 deletions

View File

@@ -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';
}

View File

@@ -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);
}

View File

@@ -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...");
}
}