Commit 2421c75f authored by alexpott's avatar alexpott

Issue #2153469 by Garrett Albright, olli, swentel, webchick: View page display...

Issue #2153469 by Garrett Albright, olli, swentel, webchick: View page display getting re-ordered on import, leading config system to believe it hasn't been imported yet.
parent c9a8e335
......@@ -198,7 +198,7 @@ public function addDisplay($plugin_id = 'page', $title = NULL, $id = NULL) {
'display_plugin' => $plugin_id,
'id' => $id,
'display_title' => $title,
'position' => count($this->display),
'position' => $id === 'default' ? 0 : count($this->display),
'provider' => $plugin['provider'],
'display_options' => array(),
);
......
......@@ -240,6 +240,17 @@ protected function displayMethodTests() {
$display = $view->get('display');
$this->assertEqual($display[$id]['display_title'], 'Page 3');
// Ensure the 'default' display always has position zero, regardless of when
// it was created relative to other displays.
$displays = $view->get('display');
$displays['default']['deleted'] = TRUE;
$view->set('display', $displays);
$view->set('id', $this->randomName());
$view->save();
$view->addDisplay('default', $random_title);
$displays = $view->get('display');
$this->assertEqual($displays['default']['position'], 0, 'Default displays are always in position zero');
// Tests Drupal\views\Entity\View::generateDisplayId().
// @todo Sadly this method is not public so it cannot be tested.
// $view = $this->controller->create(array());
......
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