Merge branch 'MDL-56834-master-fix1' of http://github.com/damyon/moodle

This commit is contained in:
David Monllao 2016-11-15 08:52:34 +08:00
commit 4b96878ab6

View file

@ -619,7 +619,7 @@ class core_renderer extends \core_renderer {
$navbarnode = end($items); $navbarnode = end($items);
// We only want to show the menu on the first page of the activity. This means // We only want to show the menu on the first page of the activity. This means
// the breadcrumb has no additional nodes. // the breadcrumb has no additional nodes.
if ($navbarnode->key == $node->key && $navbarnode->type == $node->type) { if ($navbarnode && ($navbarnode->key == $node->key && $navbarnode->type == $node->type)) {
$buildmenu = true; $buildmenu = true;
} }
} }
@ -635,7 +635,7 @@ class core_renderer extends \core_renderer {
$items = $this->page->navbar->get_items(); $items = $this->page->navbar->get_items();
$navbarnode = end($items); $navbarnode = end($items);
if ($navbarnode->key == 'participants') { if ($navbarnode && ($navbarnode->key == 'participants')) {
$node = $this->page->settingsnav->find('users', navigation_node::TYPE_CONTAINER); $node = $this->page->settingsnav->find('users', navigation_node::TYPE_CONTAINER);
if ($node) { if ($node) {
// Build an action menu based on the visible nodes from this navigation tree. // Build an action menu based on the visible nodes from this navigation tree.