diff --git a/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php index e9f0151..8deed69 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentFormController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php @@ -212,9 +212,7 @@ public function form(array $form, array &$form_state) { '#access' => $is_admin, ); - $form['subject'] += array( - '#access' => $instance->getSetting('subject'), - ); + $form['subject']['#access'] = $instance->getSetting('subject'); unset($form['subject']['widget'][0]['value']['#description']); // Used for conditional validation of author fields. diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentBookTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentBookTest.php index 4d92e9d..719a303 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentBookTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentBookTest.php @@ -69,7 +69,7 @@ public function testBookCommentPrint() { $this->assertText($comment_subject, 'Comment subject found'); $this->assertText($comment_body, 'Comment body found'); $this->assertText(t('Add new comment'), 'Comment form found'); - $this->assertField('subject', 'Comment form subject found'); + $this->assertField('subject[0][value]', 'Comment form subject found'); $this->drupalGet('book/export/html/' . $book_node->id()); diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationUiTest.php b/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationUiTest.php index 9aa1a1c..405aaf5 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationUiTest.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationUiTest.php @@ -299,7 +299,7 @@ public function testContactConfigEntityTranslation() { // Submit feedback. $edit = array( - 'subject[0][value]' => 'Test subject', + 'subject' => 'Test subject', 'message' => 'Test message', ); $this->drupalPostForm(NULL, $edit, t('Send message')); diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchCommentCountToggleTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchCommentCountToggleTest.php index 5f77bd0..497173a 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchCommentCountToggleTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchCommentCountToggleTest.php @@ -61,7 +61,7 @@ function setUp() { // Create a comment array $edit_comment = array(); - $edit_comment['subject'] = $this->randomName(); + $edit_comment['subject[0][value]'] = $this->randomName(); $edit_comment['comment_body[0][value]'] = $this->randomName(); // Post comment to the test node with comment diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php index b470ae6..1b44aa4 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php @@ -82,7 +82,7 @@ function testSearchResultsComment() { $node = $this->drupalCreateNode(array('type' => 'article')); // Post a comment using 'Full HTML' text format. $edit_comment = array(); - $edit_comment['subject'] = 'Test comment subject'; + $edit_comment['subject[0][value]'] = 'Test comment subject'; $edit_comment['comment_body[0][value]'] = '

' . $comment_body . '

'; $full_html_format_id = 'full_html'; $edit_comment['comment_body[0][format]'] = $full_html_format_id; @@ -94,12 +94,12 @@ function testSearchResultsComment() { // Search for the comment subject. $edit = array( - 'search_block_form' => "'" . $edit_comment['subject'] . "'", + 'search_block_form' => "'" . $edit_comment['subject[0][value]'] . "'", ); $this->drupalPostForm('', $edit, t('Search')); $node2 = node_load($node->id(), TRUE); $this->assertText($node2->label(), 'Node found in search results.'); - $this->assertText($edit_comment['subject'], 'Comment subject found in search results.'); + $this->assertText($edit_comment['subject[0][value]'], 'Comment subject found in search results.'); // Search for the comment body. $edit = array( @@ -145,7 +145,7 @@ function testSearchResultsCommentAccess() { // Post a comment using 'Full HTML' text format. $edit_comment = array(); - $edit_comment['subject'] = $this->comment_subject; + $edit_comment['subject[0][value]'] = $this->comment_subject; $edit_comment['comment_body[0][value]'] = '

' . $comment_body . '

'; $this->drupalPostForm('comment/reply/node/' . $this->node->id() . '/comment', $edit_comment, t('Save'));