From fd2ebdf36d6c4397fb326bb48c55c361e6813ba3 Mon Sep 17 00:00:00 2001
From: Alexander Bias <alexander.bias@uni-ulm.de>
Date: Thu, 16 Sep 2021 15:17:32 +0200
Subject: [PATCH] Regression: The switch role functionality caused a fatal
 error with some theme configurations

---
 CHANGES.md   | 4 ++++
 locallib.php | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/CHANGES.md b/CHANGES.md
index 9ef5cb4..4ae8daa 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -4,6 +4,10 @@ moodle-theme_boost_campus
 Changes
 -------
 
+### Unreleased
+
+* 2021-09-16 - Regression: The switch role functionality caused a fatal error with some theme configurations - Thanks to Klaus Steitz.
+
 ### v3.10-r8
 
 * 2021-08-17 - Bugfix: The timed info banner had a wrong CSS ID - Credits to Tim Schroeder.
diff --git a/locallib.php b/locallib.php
index c0ad08a..0270e76 100644
--- a/locallib.php
+++ b/locallib.php
@@ -542,6 +542,9 @@ function theme_boost_campus_show_timed_banner_on_selected_page($now, $timedibsho
 function theme_boost_campus_get_course_information_banners() {
     global $CFG, $COURSE, $PAGE, $USER;
 
+    // Require user library.
+    require_once($CFG->dirroot.'/user/lib.php');
+
     // Initialize HTML code.
     $html = '';
 
-- 
GitLab