diff --git a/core/modules/views/src/Tests/Plugin/PagerTest.php b/core/modules/views/src/Tests/Plugin/PagerTest.php index 46e75bc..73e56bd 100644 --- a/core/modules/views/src/Tests/Plugin/PagerTest.php +++ b/core/modules/views/src/Tests/Plugin/PagerTest.php @@ -36,6 +36,8 @@ class PagerTest extends PluginTestBase { * @see http://drupal.org/node/652712 */ public function testStorePagerSettings() { + // Show the master display so the override selection is shown. + config('views.settings')->set('ui.show.master_display', TRUE)->save(); $admin_user = $this->drupalCreateUser(array('administer views', 'administer site configuration')); $this->drupalLogin($admin_user); // Test behavior described in http://drupal.org/node/652712#comment-2354918. @@ -92,7 +94,7 @@ public function testStorePagerSettings() { $edit = array( 'pager[type]' => 'mini', ); - $this->drupalPostForm('admin/structure/views/nojs/display/test_store_pager_settings/page_1/pager', $edit, t('Apply')); + $this->drupalPostForm('admin/structure/views/nojs/display/test_store_pager_settings/default/pager', $edit, t('Apply')); $this->drupalGet('admin/structure/views/view/test_store_pager_settings/edit'); $this->assertText('Mini', 'Changed pager plugin, should change some text'); diff --git a/core/modules/views_ui/admin.inc b/core/modules/views_ui/admin.inc index 7ee7df4..476b04d 100644 --- a/core/modules/views_ui/admin.inc +++ b/core/modules/views_ui/admin.inc @@ -312,6 +312,13 @@ function views_ui_standard_display_dropdown(&$form, FormStateInterface $form_sta '#title' => t('For'), // @TODO: Translators may need more context than this. '#options' => $display_dropdown, ); + + // The dropdown should be hidden if there is no master shown and just one + // additional display (mostly page). + if (!config('views.settings')->get('ui.show.master_display')) { + $form['override']['dropdown']['#access'] = count($displays) > 2; + } + if ($current_display->isDefaulted($section)) { $form['override']['dropdown']['#default_value'] = 'defaults'; }