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 9ec952f commit ea049ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/outputlib.php
Original file line number Diff line number Diff line change
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 ea049ee

Please sign in to comment.