Skip to content
Permalink
Browse files

determine currentleaf independent of cache (mostly useful for unit te…

…sts)
  • Loading branch information...
flack committed Aug 12, 2019
1 parent 08b78b0 commit 4c6769e4807b34d856d08592cdc3055f8bad4392
Showing with 9 additions and 7 deletions.
  1. +9 −7 lib/midcom/helper/nav/backend.php
@@ -268,15 +268,17 @@ private function _loadNodeData($topic)
// The node is visible, add it to the list.
self::$_nodes[$id] = $node;
// Set the current leaf, this does *not* load the leaves from the DB, this is done during get_leaf.
if ($node->id === $this->_current) {
$currentleaf = midcom_baseclasses_components_configuration::get($node->component, 'active_leaf');
if ($currentleaf !== false) {
$this->_currentleaf = "{$node->id}-{$currentleaf}";
}
} else {
$node = self::$_nodes[$id];
}
// Set the current leaf, this does *not* load the leaves from the DB, this is done during get_leaf.
if ($node->id === $this->_current) {
$currentleaf = midcom_baseclasses_components_configuration::get($node->component, 'active_leaf');
if ($currentleaf !== false) {
$this->_currentleaf = "{$node->id}-{$currentleaf}";
}
}
return MIDCOM_ERROK;
}

0 comments on commit 4c6769e

Please sign in to comment.
You can’t perform that action at this time.