diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 617733ebfc..a1a53a6585 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -461,6 +461,7 @@ function watchdog_exception($type, Exception $exception, $message = NULL, $varia * Use \Drupal::service('messenger')->addMessage() instead. */ function drupal_set_message($message = NULL, $type = 'status', $repeat = FALSE) { + @trigger_error("drupal_set_message() is deprecated Drupal 8.5.0, will be removed before Drupal 9.0.0. Use \Drupal::service('messenger')->addMessage() instead. See https://www.drupal.org/node/2774931", E_USER_DEPRECATED); /* @var \Drupal\Core\Messenger\MessengerInterface $messenger */ $messenger = \Drupal::service('messenger'); $messenger->addMessage($message, $type, $repeat); @@ -498,6 +499,7 @@ function drupal_set_message($message = NULL, $type = 'status', $repeat = FALSE) * \Drupal::service('messenger')>getMessagesByType() instead. */ function drupal_get_messages($type = NULL, $clear_queue = TRUE) { + @trigger_error("drupal_get_message() is deprecated Drupal 8.5.0, will be removed before Drupal 9.0.0. Use \Drupal::service('messenger')->addMessage() instead. See https://www.drupal.org/node/2774931", E_USER_DEPRECATED); /** @var \Drupal\Core\Messenger\MessengerInterface $messenger */ $messenger = \Drupal::hasService('messenger') ? \Drupal::service('messenger') : NULL; if ($messenger && ($messages = $messenger->all())) { diff --git a/core/tests/Drupal/Tests/Listeners/DeprecationListener.php b/core/tests/Drupal/Tests/Listeners/DeprecationListener.php index 3673376d61..47924af71a 100644 --- a/core/tests/Drupal/Tests/Listeners/DeprecationListener.php +++ b/core/tests/Drupal/Tests/Listeners/DeprecationListener.php @@ -111,6 +111,8 @@ public static function getSkippedDeprecations() { 'The Drupal\migrate_drupal\Plugin\migrate\source\d6\i18nVariable is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use Drupal\migrate_drupal\Plugin\migrate\source\d6\VariableTranslation', 'Implicit cacheability metadata bubbling (onto the global render context) in normalizers is deprecated since Drupal 8.5.0 and will be removed in Drupal 9.0.0. Use the "cacheability" serialization context instead, for explicit cacheability metadata bubbling. See https://www.drupal.org/node/2918937', 'Automatically creating the first item for computed fields is deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\TypedData\ComputedItemListTrait instead.', + 'drupal_set_message() is deprecated Drupal 8.5.0, will be removed before Drupal 9.0.0. Use \Drupal::service(\'messenger\')->addMessage() instead. See https://www.drupal.org/node/2774931', + 'drupal_get_message() is deprecated Drupal 8.5.0, will be removed before Drupal 9.0.0. Use \Drupal::service(\'messenger\')->addMessage() instead. See https://www.drupal.org/node/2774931', ]; }