Skip to content

Commit

Permalink
Remove assumtion that syscontext->id = 1
Browse files Browse the repository at this point in the history
  • Loading branch information
NJahreis authored Apr 12, 2024
1 parent b5a84c5 commit bdfd150
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,8 @@ function theme_boost_union_get_additionalresources_templatecontext() {
// Iterate over the files and fill the templatecontext of the file list.
$filesforcontext = [];
foreach ($files as $af) {
$urlpersistent = new moodle_url('/pluginfile.php/1/theme_boost_union/additionalresources/0/'.$af->get_filename());
$urlrevisioned = new moodle_url('/pluginfile.php/1/theme_boost_union/additionalresources/'.theme_get_revision().
$urlpersistent = new moodle_url('/pluginfile.php/' . $systemcontext->id . '/theme_boost_union/additionalresources/0/'.$af->get_filename());
$urlrevisioned = new moodle_url('/pluginfile.php/' . $systemcontext->id . '/theme_boost_union/additionalresources/'.theme_get_revision().
'/'.$af->get_filename());
$filesforcontext[] = ['filename' => $af->get_filename(),
'filetype' => $af->get_mimetype(),
Expand Down Expand Up @@ -799,7 +799,7 @@ function theme_boost_union_get_customfonts_templatecontext() {
}

// Otherwise, fill the templatecontext of the file list.
$urlpersistent = new moodle_url('/pluginfile.php/1/theme_boost_union/customfonts/0/'.$filename);
$urlpersistent = new moodle_url('/pluginfile.php/' . $systemcontext->id . '/theme_boost_union/customfonts/0/'.$filename);
$filesforcontext[] = ['filename' => $filename,
'fileurlpersistent' => $urlpersistent->out(), ];
}
Expand Down Expand Up @@ -1839,7 +1839,8 @@ function theme_boost_union_get_touchicons_html_for_page() {
// If the file exists (i.e. it has been uploaded).
if ($file->exists == true) {
// Build the file URL.
$fileurl = new moodle_url('/pluginfile.php/1/theme_boost_union/touchiconsios/' .
$systemcontext = \context_system::instance();
$fileurl = new moodle_url('/pluginfile.php/' . $systemcontext->id . '/theme_boost_union/touchiconsios/' .
theme_get_revision().'/'.$file->filename);

// Compose and append the HTML tag.
Expand Down

0 comments on commit bdfd150

Please sign in to comment.