diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/Attachment.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/Attachment.php index 8f7f309..13c5a5a 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/Attachment.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/Attachment.php @@ -217,12 +217,13 @@ public function submitOptionsForm(&$form, &$form_state) { // It is very important to call the parent function here: parent::submitOptionsForm($form, $form_state); switch ($form_state['section']) { + case 'displays': + $form_state['values'][$form_state['section']] = array_filter($form_state['values'][$form_state['section']]); case 'inherit_arguments': case 'inherit_pager': case 'render_pager': case 'inherit_exposed_filters': case 'attachment_position': - case 'displays': $this->setOption($form_state['section'], $form_state['values'][$form_state['section']]); break; } diff --git a/core/modules/views/lib/Drupal/views/Tests/UI/DisplayAttachmentTest.php b/core/modules/views/lib/Drupal/views/Tests/UI/DisplayAttachmentTest.php index 9574d75..b5bbd23 100644 --- a/core/modules/views/lib/Drupal/views/Tests/UI/DisplayAttachmentTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/UI/DisplayAttachmentTest.php @@ -44,8 +44,7 @@ public function testAttachmentUI() { } // Save the attachments and test the value on the view. - $this->drupalGet($attachment_display_url); - $this->drupalPost(NULL, array('displays[page_1]' => 1), t('Apply')); + $this->drupalPost($attachment_display_url, array('displays[page_1]' => 1), t('Apply')); $result = $this->xpath('//a[@id = :id]', array(':id' => 'views-attachment-1-displays')); $this->assertEqual($result[0]->attributes()->title, t('Page')); $this->drupalPost(NULL, array(), t('Save')); @@ -54,14 +53,13 @@ public function testAttachmentUI() { $view->initDisplay(); $this->assertEqual(array_keys(array_filter($view->displayHandlers->get('attachment_1')->getOption('displays'))), array('page_1'), 'The attached displays got saved as expected'); - $this->drupalGet($attachment_display_url); - $this->drupalPost(NULL, array('displays[default]' => 1, 'displays[page_1]' => 1), t('Apply')); + $this->drupalPost($attachment_display_url, array('displays[default]' => 1, 'displays[page_1]' => 1), t('Apply')); $result = $this->xpath('//a[@id = :id]', array(':id' => 'views-attachment-1-displays')); $this->assertEqual($result[0]->attributes()->title, t('Multiple displays')); $this->drupalPost(NULL, array(), t('Save')); $view = views_get_view('test_attachment_ui'); $view->initDisplay(); - $this->assertEqual(array_keys(array_filter($view->displayHandlers->get('attachment_1')->getOption('displays'))), array('default', 'page_1'), 'The attached displays got saved as expected'); + $this->assertEqual(array_keys($view->displayHandlers->get('attachment_1')->getOption('displays')), array('default', 'page_1'), 'The attached displays got saved as expected'); } }