diff --git a/core/includes/errors.inc b/core/includes/errors.inc index 20b30f9..c0cf4e0 100644 --- a/core/includes/errors.inc +++ b/core/includes/errors.inc @@ -198,9 +198,8 @@ function _drupal_log_error($error, $fatal = FALSE) { } // Attempt to reduce verbosity by removing DRUPAL_ROOT from the file path - // in the message. This does not happen for (false) security. This can - // only be done if \Drupal::$container is set. - if ($container = \Drupal::getContainer()) { + // in the message. This does not happen for (false) security. + if (\Drupal::hasService('app.root')) { $root_length = strlen(\Drupal::root()); if (substr($error['%file'], 0, $root_length) == \Drupal::root()) { $error['%file'] = substr($error['%file'], $root_length + 1); @@ -221,9 +220,8 @@ function _drupal_log_error($error, $fatal = FALSE) { // Generate a backtrace containing only scalar argument values. $message .= '
' . Error::formatBacktrace($backtrace) . ''; } - if ($container) { - // The message service is only available if the container has been - // instantiated. + if (\Drupal::hasService('session_manager')) { + // Message display is dependent on sessions being available. drupal_set_message(SafeMarkup::set($message), $class, TRUE); } else {