diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/row/EntityRow.php b/core/modules/views/lib/Drupal/views/Plugin/views/row/EntityRow.php index 363bc0c..293d6f6 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/row/EntityRow.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/row/EntityRow.php @@ -95,7 +95,7 @@ public static function create(ContainerInterface $container, array $configuratio protected function defineOptions() { $options = parent::defineOptions(); - $options['view_mode'] = array('default' => ''); + $options['view_mode'] = array('default' => 'default'); return $options; } @@ -119,7 +119,7 @@ public function buildOptionsForm(&$form, &$form_state) { * Return the main options, which are shown in the summary title. */ protected function buildViewModeOptions() { - $options = array(); + $options = array('default' => t('Default')); $view_modes = entity_get_view_modes($this->entityType); foreach ($view_modes as $mode => $settings) { $options[$mode] = $settings['label']; diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/RowEntityTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/RowEntityTest.php index faf1395..ca826c4 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/RowEntityTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/RowEntityTest.php @@ -69,6 +69,14 @@ public function testEntityRow() { $this->content = drupal_render($this->content); $this->assertText($term->label(), 'The rendered entity appears as row in the view.'); + + // Tests the available view mode options. + $form = array(); + $form_state = array(); + $view->rowPlugin->buildOptionsForm($form, $form_state); + + $this->assertTrue(isset($form['view_mode']['options']['full']), 'Ensure that the full view mode is available'); + $this->assertTrue(isset($form['view_mode']['options']['default']), 'Ensure that the default view mode is available'); } /**