Skip to content

Commit

Permalink
Merge branch 'MDL-58936_master' of git://github.com/markn86/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed May 15, 2017
2 parents ca4f5a6 + 004dcb4 commit 52836e3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/outputrequirementslib.php
Expand Up @@ -315,6 +315,12 @@ public function get_config_for_javascript(moodle_page $page, renderer_base $rend

$iconsystem = \core\output\icon_system::instance();

// It is possible that the $page->context is null, so we can't use $page->context->id.
$contextid = null;
if (!is_null($page->context)) {
$contextid = $page->context->id;
}

$this->M_cfg = array(
'wwwroot' => $CFG->httpswwwroot, // Yes, really. See above.
'sesskey' => sesskey(),
Expand All @@ -326,7 +332,7 @@ public function get_config_for_javascript(moodle_page $page, renderer_base $rend
'admin' => $CFG->admin,
'svgicons' => $page->theme->use_svg_icons(),
'usertimezone' => usertimezone(),
'contextid' => $page->context->id,
'contextid' => $contextid,
);
if ($CFG->debugdeveloper) {
$this->M_cfg['developerdebug'] = true;
Expand Down

0 comments on commit 52836e3

Please sign in to comment.