From e0d8e66bf4966fc8ea4a939ca990d6ca322737fa Mon Sep 17 00:00:00 2001 From: webchick Date: Wed, 30 Oct 2013 17:03:21 -0700 Subject: [PATCH] Issue #2119881 by damiankloip, dawehner | joachim: Fixed views BulkFormBase shows 'Apply' button twice. --- core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php | 4 ++++ core/modules/views/views.module | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php b/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php index ea83db28ad4..86edb199393 100644 --- a/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php +++ b/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php @@ -49,6 +49,10 @@ class BulkFormTest extends WebTestBase { $this->drupalGet('test_bulk_form'); + // Test that the views edit header appears first. + $first_form_element = $this->xpath('//form/div/div[1][@id = :id]', array(':id' => 'edit-header')); + $this->assertTrue($first_form_element, 'The views form edit header appears first.'); + $this->assertFieldById('edit-action', NULL, 'The action select field appears.'); // Make sure a checkbox appears on all rows. diff --git a/core/modules/views/views.module b/core/modules/views/views.module index edc5ec14cfa..279f14c05f0 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -1234,8 +1234,9 @@ function views_pre_render_views_form_views_form($element) { // Apply substitutions to the rendered output. $element['output']['#markup'] = str_replace($search, $replace, $element['output']['#markup']); - // Render and add remaining form fields. - $element['#children'] = drupal_render_children($element); + // Sort, render and add remaining form fields. + $children = element_children($element, TRUE); + $element['#children'] = drupal_render_children($element, $children); return $element; }