Issue #2057199 by lauriii, olli: Unable to select the 'Default' view mode for custom block.
parent
da7d7a95e2
commit
e8251b2a5f
|
@ -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'];
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue