We have enabled https for gradebook pages on our Moodle site and find that in courses that use the Essential theme, much of the style is not being loaded. I looked at the source for an affected gradebook page and saw that the stylesheet link looks like this (note: I have replaced our actual domain with 'ourdomain.ourdomain below, but it is correct in original source view):
<link rel="stylesheet" href="//ourdomain.ourdomain.ca/pluginfile.php/1/theme_essential/style/-1/essential.css">
What's missing here is the 'https:' and as a result, the css file is being requested over http.
Digging into the Essential theme code, I found that the URL for this link is built with a function called get_csswww(), which is in the \[moodleroot]\theme\essential\renderers\core_renderer.php file. The get_csswww() function is:
public function get_csswww() {
global $CFG;
if (!$this->theme_essential_lte_ie9()) {
if (right_to_left()) {
$moodlecss = 'essential-rtl.css';
} else {
$moodlecss = 'essential.css';
}
$syscontext = context_system::instance();
$itemid = theme_get_revision();
$url = moodle_url::make_file_url("$CFG->wwwroot/pluginfile.php", "/$syscontext->id/theme_essential/style/$itemid/$moodlecss");
$url = preg_replace('|^https?://|i', '//', $url->out(false));
return '<link rel="stylesheet" href="'.$url.'">';
} else {
if (right_to_left()) {
$moodlecssone = 'essential-rtl_ie9-blessed1.css';
$moodlecsstwo = 'essential-rtl_ie9.css';
} else {
$moodlecssone = 'essential_ie9-blessed1.css';
$moodlecsstwo = 'essential_ie9.css';
}
$syscontext = context_system::instance();
$itemid = theme_get_revision();
$urlone = moodle_url::make_file_url("$CFG->wwwroot/pluginfile.php", "/$syscontext->id/theme_essential/style/$itemid/$moodlecssone");
$urlone = preg_replace('|^https?://|i', '//', $urlone->out(false));
$urltwo = moodle_url::make_file_url("$CFG->wwwroot/pluginfile.php", "/$syscontext->id/theme_essential/style/$itemid/$moodlecsstwo");
$urltwo = preg_replace('|^https?://|i', '//', $urltwo->out(false));
return '<link rel="stylesheet" href="'.$urlone.'"><link rel="stylesheet" href="'.$urltwo.'">';
}
}
From what I can tell, this code is looking for 'https:' in the URL and stripping it out before returning it to the file that builds the page. I have tried commenting out the lines that strip out the 'https:' but caused other problems by doing so.
We are running Moodle 2.7.11 and Essential 2.7.9.5.2 (Build: 2014111010). Any assistance with this would be greatly appreciated.
Thanks,
Trevar