diff --git a/CHANGES.md b/CHANGES.md index 783901ff322496c1eac3e6a9d3b8de68ce376184..92ccfe66c59b02d8ae3bc2c4dd061ea93f46cc7b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Changes ### Unreleased +* 2022-11-03 - Bugfix: Return Boost Campus favicon as moodle_url instead of string, solves #120. * 2022-07-10 - Add Capabilities section to README.md ### v3.11-r3 diff --git a/classes/output/core_renderer.php b/classes/output/core_renderer.php index dcd8a5cb69e4fb0b69b15740936d830766df310e..1807bf58fe39daa4068d757e410c6af1a6d0ed6c 100644 --- a/classes/output/core_renderer.php +++ b/classes/output/core_renderer.php @@ -46,6 +46,7 @@ use paging_bar; use url_select; use context_course; use pix_icon; +use context_system; /** * Extending the core_renderer interface. @@ -97,14 +98,21 @@ class core_renderer extends \core_renderer { * * @since Moodle 2.5.1 2.6 * @return moodle_url The moodle_url for the favicon + * @throws \moodle_exception */ public function favicon() { // MODIFICATION START. - if (!empty($this->page->theme->settings->favicon)) { - return $this->page->theme->setting_file_url('favicon', 'favicon'); - } else { + $logo = null; + if (!during_initial_install()) { + $logo = get_config('theme_boost_campus', 'favicon'); + } + if (empty($logo)) { return $this->image_url('favicon', 'theme'); } + + // Use $CFG->themerev to prevent browser caching when the file changes. + return moodle_url::make_pluginfile_url(context_system::instance()->id, 'theme_boost_campus', 'favicon', '', + theme_get_revision(), $logo); // MODIFICATION END. // @codingStandardsIgnoreStart /* ORIGINAL START.