diff --git a/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php b/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php index ea83db28ad41ff03a855156e80c24b97d23fb3f0..86edb19939395173cc18377c84a6abad0eae9861 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 @@ public function testBulkForm() { $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 edc5ec14cfa65ed8ce5800a53cc81e829a71611c..279f14c05f013693a437d68c1fa51b7e9bc92f91 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; }