Skip to content
Snippets Groups Projects
Commit b8db52f6 authored by Alex Pott's avatar Alex Pott
Browse files

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

parent 8bcdbf2c
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment