diff --git a/core/modules/comment/src/CommentForm.php b/core/modules/comment/src/CommentForm.php index e2b88f71e5..c6fed217ec 100644 --- a/core/modules/comment/src/CommentForm.php +++ b/core/modules/comment/src/CommentForm.php @@ -112,8 +112,8 @@ public function form(array $form, FormStateInterface $form_state) { $anonymous_contact = $field_definition->getSetting('anonymous'); $is_admin = $comment->id() && $this->currentUser->hasPermission('administer comments'); + $form['#attached']['library'][] = 'core/drupal.form'; if (!$this->currentUser->isAuthenticated() && $anonymous_contact != CommentInterface::ANONYMOUS_MAYNOT_CONTACT) { - $form['#attached']['library'][] = 'core/drupal.form'; $form['#attributes']['data-user-info-from-browser'] = TRUE; } diff --git a/core/tests/Drupal/FunctionalTests/EventSubscriber/MainContentViewSubscriberTest.php b/core/tests/Drupal/FunctionalTests/EventSubscriber/MainContentViewSubscriberTest.php new file mode 100644 index 0000000000..d991aecb07 --- /dev/null +++ b/core/tests/Drupal/FunctionalTests/EventSubscriber/MainContentViewSubscriberTest.php @@ -0,0 +1,37 @@ +drupalLogin($this->rootUser); + $this->drupalGet("/user?_wrapper_format=drupal_dialog"); + $this->assertSession()->addressEquals('/user%3F_wrapper_format%3Ddrupal_dialog'); + } + +}