From ea049ee61831b77fc14a24a3d0f2e0b50fc03241 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Tue, 21 Feb 2017 11:50:47 +0000 Subject: [PATCH] MDL-58035 lib: log when the expected theme cannot be initialised --- lib/outputlib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/outputlib.php b/lib/outputlib.php index 1c4f4788210..8b9f231b57e 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -499,10 +499,15 @@ class theme_config { throw new coding_exception('Default theme '.theme_config::DEFAULT_THEME.' not available or broken!'); } else if ($config = theme_config::find_theme_config($CFG->theme, $settings)) { + debugging('This page should be using theme ' . $themename . + ' which cannot be initialised. Falling back to the site theme ' . $CFG->theme, DEBUG_NORMAL); return new theme_config($config); } else { // bad luck, the requested theme has some problems - admin see details in theme config + debugging('This page should be using theme ' . $themename . + ' which cannot be initialised. Nor can the site theme ' . $CFG->theme . + '. Falling back to ' . theme_config::DEFAULT_THEME, DEBUG_NORMAL); return new theme_config(theme_config::find_theme_config(theme_config::DEFAULT_THEME, $settings)); } }