Skip to content
Snippets Groups Projects
Verified Commit a46238e3 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3045125 by vadim.hirbu: Possible wrong token assignment on display modes

(cherry picked from commit 67fd16dc)
parent d0ebe15f
No related branches found
No related tags found
No related merge requests found
...@@ -117,7 +117,7 @@ public function render() { ...@@ -117,7 +117,7 @@ public function render() {
'data' => [ 'data' => [
'#type' => 'link', '#type' => 'link',
'#url' => Url::fromRoute($short_type == 'view' ? 'entity.entity_view_mode.add_form' : 'entity.entity_form_mode.add_form', ['entity_type_id' => $entity_type]), '#url' => Url::fromRoute($short_type == 'view' ? 'entity.entity_view_mode.add_form' : 'entity.entity_form_mode.add_form', ['entity_type_id' => $entity_type]),
'#title' => $this->t('Add new %label @entity-type', ['%label' => $this->entityTypes[$entity_type]->getLabel(), '@entity-type' => $this->entityType->getLowercaseLabel()]), '#title' => $this->t('Add new @entity-type %label', ['@entity-type' => $this->entityTypes[$entity_type]->getLabel(), '%label' => $this->entityType->getLowercaseLabel()]),
], ],
'colspan' => count($table['#header']), 'colspan' => count($table['#header']),
]; ];
......
...@@ -28,7 +28,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $entity_t ...@@ -28,7 +28,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $entity_t
// Change replace_pattern to avoid undesired dots. // Change replace_pattern to avoid undesired dots.
$form['id']['#machine_name']['replace_pattern'] = '[^a-z0-9_]+'; $form['id']['#machine_name']['replace_pattern'] = '[^a-z0-9_]+';
$definition = $this->entityTypeManager->getDefinition($this->targetEntityTypeId); $definition = $this->entityTypeManager->getDefinition($this->targetEntityTypeId);
$form['#title'] = $this->t('Add new %label @entity-type', ['%label' => $definition->getLabel(), '@entity-type' => $this->entityType->getLowercaseLabel()]); $form['#title'] = $this->t('Add new @entity-type %label', ['@entity-type' => $definition->getLabel(), '%label' => $this->entityType->getLowercaseLabel()]);
return $form; return $form;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment