diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index ba3d51c..5fcec7b 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -934,6 +934,11 @@ function drupal_set_message($message = NULL, $type = 'status', $repeat = FALSE) * \Drupal::service('messenger')->getMessagesByType() instead. */ function drupal_get_messages($type = NULL, $clear_queue = TRUE) { + // Workaround for code that can not check if the service exists. + if (!\Drupal::hasService('messenger')) { + return array(); + } + /** @var \Drupal\Core\Messenger\MessengerInterface $messenger */ $messenger = \Drupal::service('messenger');