Skip to content

Commit

Permalink
MDL-58035 lib: log when the expected theme cannot be initialised
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Mar 7, 2017
1 parent 29cdf58 commit 1e1e1b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/outputlib.php
Expand Up @@ -499,10 +499,15 @@ public static function load($themename) {
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));
}
}
Expand Down

0 comments on commit 1e1e1b8

Please sign in to comment.