diff -u b/core/includes/errors.inc b/core/includes/errors.inc --- b/core/includes/errors.inc +++ b/core/includes/errors.inc @@ -153,13 +153,7 @@ * TRUE if an error should be displayed. */ function error_displayable($error = NULL) { - try { - $error_level = config('system.logging')->get('error_level'); - } - catch (Exception $e) { - // During very early install the cache_config table does not exist. - $error_level = ERROR_REPORTING_DISPLAY_ALL; - } + $error_level = _drupal_get_error_level(); $updating = (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'update'); $all_errors_displayed = ($error_level == ERROR_REPORTING_DISPLAY_ALL) || ($error_level == ERROR_REPORTING_DISPLAY_VERBOSE); @@ -260,7 +254,7 @@ $message = format_string('%type: !message in %function (line %line of %file).', $error); // Check if verbose error reporting is on. - $error_level = config('system.logging')->get('error_level'); + $error_level = _drupal_get_error_level(); if ($error_level == ERROR_REPORTING_DISPLAY_VERBOSE) { // First trace is the error itself, already contained in the message. @@ -293,6 +287,19 @@ } /** + * Returns the current error level. + */ +function _drupal_get_error_level() { + try { + return config('system.logging')->get('error_level'); + } + catch (Exception $e) { + // During very early install the cache_config table does not exist. + return ERROR_REPORTING_DISPLAY_ALL; + } +} + +/** * Gets the last caller from a backtrace. * * @param $backtrace only in patch2: unchanged: --- a/core/includes/theme.maintenance.inc +++ b/core/includes/theme.maintenance.inc @@ -50,7 +50,17 @@ function _drupal_maintenance_theme() { // Stark otherwise. Since there is no low-level access to configuration // currently, we only consult settings.php and fall back to Bartik // otherwise, as it looks generic enough and way more user-friendly. - $custom_theme = variable_get('maintenance_theme', config('system.theme')->get('default')) ?: 'bartik'; + $custom_theme = variable_get('maintenance_theme'); + if (!$custom_theme) { + $config = config('system.theme'); + // A broken install might not return an object. + if (is_object($config)) { + $custom_theme = config('system.theme')->get('default'); + } + } + if (!$custom_theme) { + $custom_theme = 'bartik'; + } } // Ensure that system.module is loaded.