Commit db7834de authored by alexpott's avatar alexpott

Issue #2810057 by arijits.drush, Lendude: WSOD after renaming and deleting a views display

parent b0abe179
......@@ -81,6 +81,16 @@ public function testRemoveDisplay() {
$this->drupalPostForm(NULL, array(), t('Save'));
$this->assertNoLinkByHref($path_prefix . '/page_1', 'Make sure there is no display tab for the deleted display.');
// Test deleting a display that has a modified machine name.
$view = $this->randomView();
$machine_name = 'new_machine_name';
$path_prefix = 'admin/structure/views/view/' . $view['id'] . '/edit';
$this->drupalPostForm("admin/structure/views/nojs/display/{$view['id']}/page_1/display_id", array('display_id' => $machine_name), 'Apply');
$this->drupalPostForm(NULL, array(), 'Delete Page');
$this->drupalPostForm(NULL, array(), t('Save'));
$this->assertResponse(200);
$this->assertNoLinkByHref($path_prefix . '/new_machine_name', 'Make sure there is no display tab for the deleted display.');
}
/**
......
......@@ -266,7 +266,7 @@ public function save(array $form, FormStateInterface $form_state) {
// Rename display ids if needed.
foreach ($executable->displayHandlers as $id => $display) {
if (!empty($display->display['new_id'])) {
if (!empty($display->display['new_id']) && empty($display->display['deleted'])) {
$new_id = $display->display['new_id'];
$display->display['id'] = $new_id;
unset($display->display['new_id']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment