Commit b8db52f6 authored by alexpott's avatar alexpott
Browse files

Issue #2567115 by larowlan, Frando: Show type name in custom block type edit form

parent 8bcdbf2c
......@@ -76,7 +76,6 @@ entity.block_content_type.edit_form:
path: '/admin/structure/block/block-content/manage/{block_content_type}'
defaults:
_entity_form: 'block_content_type.edit'
_title: 'Edit'
requirements:
_entity_access: 'block_content_type.update'
......
......@@ -26,6 +26,13 @@ public function form(array $form, FormStateInterface $form_state) {
/* @var \Drupal\block_content\BlockContentTypeInterface $block_type */
$block_type = $this->entity;
if ($this->operation == 'add') {
$form['#title'] = $this->t('Add custom block type');
}
else {
$form['#title'] = $this->t('Edit %label custom block type', array('%label' => $block_type->label()));
}
$form['label'] = array(
'#type' => 'textfield',
'#title' => t('Label'),
......
......@@ -110,7 +110,9 @@ public function testBlockContentTypeEditing() {
$edit = array(
'label' => 'Bar',
);
$this->drupalPostForm('admin/structure/block/block-content/manage/basic', $edit, t('Save'));
$this->drupalGet('admin/structure/block/block-content/manage/basic');
$this->assertTitle(format_string('Edit @type custom block type | Drupal', ['@type' => 'basic']));
$this->drupalPostForm(NULL, $edit, t('Save'));
\Drupal::entityManager()->clearCachedFieldDefinitions();
$this->drupalGet('block/add');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment