Skip to content
Snippets Groups Projects
Commit fce26fe7 authored by catch's avatar catch
Browse files

Issue #2291721 by alexpott: Use methods instead of array access in when using...

Issue #2291721 by alexpott: Use methods instead of array access in when using DataDefinition objects from TypedConfig .
parent cb5263f0
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
......@@ -28,7 +28,7 @@ public function getFormElement(DataDefinitionInterface $definition, LanguageInte
$format = $this->t('Displayed as %date_format', array('%date_format' => \Drupal::service('date')->format(REQUEST_TIME, 'custom', $value)));
return array(
'#type' => 'textfield',
'#title' => $this->t($definition['label']) . '<span class="visually-hidden"> (' . $language->name . ')</span>',
'#title' => $this->t($definition->getLabel()) . '<span class="visually-hidden"> (' . $language->name . ')</span>',
'#description' => $description,
'#default_value' => $value,
'#attributes' => array('lang' => $language->id),
......
......@@ -29,7 +29,7 @@ public function getFormElement(DataDefinitionInterface $definition, LanguageInte
return array(
'#type' => 'textarea',
'#default_value' => $value,
'#title' => $this->t($definition['label']) . '<span class="visually-hidden"> (' . $language->name . ')</span>',
'#title' => $this->t($definition->getLabel()) . '<span class="visually-hidden"> (' . $language->name . ')</span>',
'#rows' => $rows,
'#attributes' => array('lang' => $language->id),
);
......
......@@ -24,7 +24,7 @@ public function getFormElement(DataDefinitionInterface $definition, LanguageInte
return array(
'#type' => 'textfield',
'#default_value' => $value,
'#title' => $this->t($definition['label']) . '<span class="visually-hidden"> (' . $language->name . ')</span>',
'#title' => $this->t($definition->getLabel()) . '<span class="visually-hidden"> (' . $language->name . ')</span>',
'#attributes' => array('lang' => $language->id),
);
}
......
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