diff --git a/CHANGES.md b/CHANGES.md index 1a0a52095a7..325e9327f83 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Changes ### Unreleased +* 2024-11-19 - Upgrade: Support more seamless upgrade to 4.5 by only requiring /cache/classes/loaders.php if it is present, resolves #708. * 2024-11-19 - Bugfix: The starred courses popover showed a JavaScript error in the browser JS console, resolves #759. * 2024-11-19 - Bugfix: The starred courses popover in the navbar must only be shown if Boost Union or Boost Union child is active, resolves #759. * 2024-11-18 - Improvement: Add the possibility to restrict smart menus and smart menu items to site admins and non-site admins only, resolves #421. diff --git a/classes/cache/loader.php b/classes/cache/loader.php index 21a093b4afa..5155c9e7116 100644 --- a/classes/cache/loader.php +++ b/classes/cache/loader.php @@ -26,7 +26,11 @@ defined('MOODLE_INTERNAL') || die(); -require_once($CFG->dirroot.'/cache/classes/loaders.php'); +// Require the cache loaders class, but only if the file exists (which is the case before Moodle 4.5). +// This is just done to support a seamless upgrade to 4.5. +if (file_exists($CFG->dirroot.'/cache/classes/loaders.php')) { + require_once($CFG->dirroot.'/cache/classes/loaders.php'); +} /** * Custom cache loader to handle the smart menus and items deletion.