diff --git a/CHANGES.md b/CHANGES.md
index 3694a006827630ec7e7d50c7e656a96da5418c2d..089a85045209eb0a17fd2e10643c638a22ceb755 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -6,6 +6,7 @@ Changes
 
 ### Unreleased
 
+* 2020-08-12 - Fixed undefined variables notices.
 * 2020-08-11 - Added setting to be able to show a hint for a unrestricted self enrolment in a visible course.
                NOTE: Capability theme/boost_campus:viewhintcourseselfenrol introduced.
 * 2020-08-07 - Added rule to show description border for all users for restricted activities.
diff --git a/locallib.php b/locallib.php
index a44904601beae111535dd20a8df5655f08c8c5b1..a0a6126938534b815e91f6c8416fc481db6b84bf 100644
--- a/locallib.php
+++ b/locallib.php
@@ -499,13 +499,17 @@ function theme_boost_campus_show_timed_banner_on_selected_page($now, $timedibsho
     // Check if time settings are empty and try to convert the time string_s_ to a unix timestamp.
     if (empty($timedibstartsetting)) {
         $timedibstartempty = true;
+        $timedibstart = 0;
     } else {
         $timedibstart = strtotime($timedibstartsetting);
+        $timedibstartempty = false;
     }
     if (empty($timedibendsetting)) {
         $timedibendempty = true;
+        $timedibend = 0;
     } else {
         $timedibend = strtotime($timedibendsetting);
+        $timedibendempty = false;
     }
 
     // Add the time check: