Commit 6a059360 authored by dawehner's avatar dawehner Committed by tim.plunkett

Issue #1793992 by dawehner | smiletrl: Fixed Add new displays will change the default displays?.

parent 6f920509
......@@ -73,16 +73,23 @@ public function testRemoveDisplay() {
* Tests adding a display.
*/
public function testAddDisplay() {
// Show the master display.
config('views.settings')->set('ui.show.master_display', TRUE)->save();
$settings['page[create]'] = FALSE;
$view = $this->randomView($settings);
$path_prefix = 'admin/structure/views/view/' . $view['name'] .'/edit';
$this->drupalGet($path_prefix);
$this->drupalPost(NULL, array(), t('Save'));
// Add a new display.
$this->drupalPost(NULL, array(), 'Add Page');
// @todo Revising this after http://drupal.org/node/1793700 got in.
$this->assertLinkByHref($path_prefix . '/page_1', 0, 'Make sure after adding a display the new display appears in the UI');
$this->assertNoLink('Master*', 0, 'Make sure the master display is not marked as changed.');
$this->assertLink('Page*', 0, 'Make sure the added display is marked as changed.');
}
/**
......
......@@ -789,6 +789,9 @@ public function submitDisplayAdd($form, &$form_state) {
$parents = $form_state['triggering_element']['#parents'];
$display_type = array_pop($parents);
$display_id = $this->storage->addDisplay($display_type);
// A new display got added so the asterisks symbol should appear on the new
// display.
$this->current_display = $display_id;
views_ui_cache_set($this);
// Redirect to the new display's edit page.
......
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