Issue #2136403 by damiankloip: Block display_title option shows incorrect default value on block configuration form.
parent
004fa12b8b
commit
5b164a2eb5
|
@ -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,
|
||||
);
|
||||
|
||||
|
|
|
@ -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.');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue