diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Block/CustomBlockBlock.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Block/CustomBlockBlock.php index def3fdfe9ec..a2a995989da 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Block/CustomBlockBlock.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Block/CustomBlockBlock.php @@ -92,7 +92,7 @@ class CustomBlockBlock extends BlockBase implements ContainerFactoryPluginInterf * Adds body and description fields to the block configuration form. */ public function blockForm($form, &$form_state) { - $options = array(); + $options = array('default' => t('Default')); $view_modes = entity_get_view_modes('custom_block'); foreach ($view_modes as $view_mode => $detail) { $options[$view_mode] = $detail['label']; diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php index cae2d0efa4b..dd349b85b0a 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php @@ -78,6 +78,10 @@ class CustomBlockCreationTest extends CustomBlockTestBase { $this->drupalGet('admin/structure/block/manage/testblock'); $this->assertFieldByXPath('//select[@name="settings[custom_block][view_mode]"]/option[@selected="selected"]/@value', 'test_view_mode', 'View mode changed to Test View Mode'); + // Test the available view mode options. + $this->assertOption('edit-settings-custom-block-view-mode', 'default', 'The default view mode is available.'); + $this->assertOption('edit-settings-custom-block-view-mode', 'full', 'The full view mode is available.'); + // Check that the block exists in the database. $blocks = entity_load_multiple_by_properties('custom_block', array('info' => $edit['info'])); $block = reset($blocks);