Issue #2136403 by damiankloip: Block display_title option shows incorrect default value on block configuration form.

8.0.x
Alex Pott 2013-12-01 23:02:46 -04:00
parent 004fa12b8b
commit 5b164a2eb5
2 changed files with 4 additions and 1 deletions

View File

@ -105,7 +105,7 @@ abstract class BlockBase extends PluginBase implements BlockPluginInterface {
$form['label_display'] = array(
'#type' => 'checkbox',
'#title' => $this->t('Display title'),
'#default_value' => $this->configuration['label_display'] == BlockInterface::BLOCK_LABEL_VISIBLE,
'#default_value' => ($this->configuration['label_display'] === BlockInterface::BLOCK_LABEL_VISIBLE),
'#return_value' => BlockInterface::BLOCK_LABEL_VISIBLE,
);

View File

@ -195,6 +195,9 @@ class BlockTest extends BlockTestBase {
$this->drupalPostForm('admin/structure/block/manage/' . $id, $edit, t('Save block'));
$this->assertText('The block configuration has been saved.', 'Block was saved');
$this->drupalGet('admin/structure/block/manage/' . $id);
$this->assertNoFieldChecked('edit-settings-label-display', 'The display_block option has the correct default value on the configuration form.');
$this->drupalGet('user');
$this->assertNoText($title, 'Block title was not displayed when hidden.');
}