diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 805c998..18635a6 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -553,7 +553,6 @@ function watchdog_exception($type, Exception $exception, $message = NULL, $varia * @endcode * If there are no messages set, the function returns NULL. * - * * @throws \UnexpectedValueException * When passed a render array with #attached. * @@ -577,8 +576,8 @@ function drupal_set_message($message = NULL, $type = 'status', $repeat = FALSE) // (like assets) should not be supported. if (is_array($message)) { $rendered_message = \Drupal::service('renderer')->renderPlain($message); - // The rendering will have bubbled any #attached asserts to the top - // level of $message. Throw an exception if there were any. + // The rendering will have bubbled any #attached assets to the top level + // of $message. Throw an exception if there were any. if (!empty($message['#attached'])) { throw new \UnexpectedValueException('Render arrays passed to drupal_set_message() cannot have attached assets.'); } diff --git a/core/modules/system/src/Tests/Bootstrap/DrupalSetMessageTest.php b/core/modules/system/src/Tests/Bootstrap/DrupalSetMessageTest.php index 3f442a8..85a66e0 100644 --- a/core/modules/system/src/Tests/Bootstrap/DrupalSetMessageTest.php +++ b/core/modules/system/src/Tests/Bootstrap/DrupalSetMessageTest.php @@ -58,12 +58,7 @@ function testDrupalSetMessage() { // Ensure that strings that are not marked as safe are escaped. $this->assertEscaped('Thismarkup will be escaped.'); - } - /** - * Tests drupal_set_message() with disallowed #attach. - */ - public function testAttach() { // Test render arrays that incorrectly add #attached. try { drupal_set_message(['#attached' => ['drupalSettings' => ['pecary' => TRUE]]]); @@ -83,7 +78,6 @@ public function testAttach() { catch (\UnexpectedValueException $e) { $this->pass('Render arrays passed to drupal_set_message() cannot have attached assets in child elements.'); } - } }