summaryrefslogtreecommitdiffstats
path: root/core/modules/views_ui
diff options
context:
space:
mode:
authorNathaniel Catchpole2018-02-19 12:13:43 (GMT)
committerNathaniel Catchpole2018-02-19 12:13:43 (GMT)
commit3d6a12a9bcb3b590c8740d5e504be793c7486c5d (patch)
tree9d88aa36e2301d9d413f1cf339ae4f2d9bd01f4a /core/modules/views_ui
parent7eaf9abc729ea837ec20e20380553955adf9afc4 (diff)
Issue #2915175 by vaplas, Phonoman, Lendude: Duplicating a Page to Block after changing the display id and then saving the view destroys the Page
Diffstat (limited to 'core/modules/views_ui')
-rw-r--r--core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php b/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php
index 1e53c71..c1c7cef 100644
--- a/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php
@@ -143,6 +143,16 @@ class DisplayCRUDTest extends UITestBase {
$this->assertFalse(isset($block_1->display['display_options']['path']));
$this->assertEqual($block_1->getOption('title'), $random_title, 'The overridden title option from the display got copied into the duplicate');
$this->assertEqual($block_1->getOption('css_class'), $random_css, 'The overridden css_class option from the display got copied into the duplicate');
+
+ // Test duplicating a display after changing the machine name.
+ $view_id = $view->id();
+ $this->drupalPostForm("admin/structure/views/nojs/display/$view_id/page_2/display_id", ['display_id' => 'page_new'], 'Apply');
+ $this->drupalPostForm(NULL, [], 'Duplicate as Block');
+ $this->drupalPostForm(NULL, [], t('Save'));
+ $view = Views::getView($view_id);
+ $view->initDisplay();
+ $this->assertNotNull($view->displayHandlers->get('page_new'), 'The original display is saved with a changed id');
+ $this->assertNotNull($view->displayHandlers->get('block_2'), 'The duplicate display is saved with new id');
}
}