From fce26fe78bcda45f1a118ffab2ed00130627a42f Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole <catch@35733.no-reply.drupal.org> Date: Tue, 8 Jul 2014 12:03:26 +0100 Subject: [PATCH] Issue #2291721 by alexpott: Use methods instead of array access in when using DataDefinition objects from TypedConfig . --- core/modules/config_translation/src/FormElement/DateFormat.php | 2 +- core/modules/config_translation/src/FormElement/Textarea.php | 2 +- core/modules/config_translation/src/FormElement/Textfield.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/modules/config_translation/src/FormElement/DateFormat.php b/core/modules/config_translation/src/FormElement/DateFormat.php index 25858cf15cfe..2e089cb1bdaa 100644 --- a/core/modules/config_translation/src/FormElement/DateFormat.php +++ b/core/modules/config_translation/src/FormElement/DateFormat.php @@ -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), diff --git a/core/modules/config_translation/src/FormElement/Textarea.php b/core/modules/config_translation/src/FormElement/Textarea.php index 8092e4b7bce5..e4692ec2902c 100644 --- a/core/modules/config_translation/src/FormElement/Textarea.php +++ b/core/modules/config_translation/src/FormElement/Textarea.php @@ -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), ); diff --git a/core/modules/config_translation/src/FormElement/Textfield.php b/core/modules/config_translation/src/FormElement/Textfield.php index a4a820f1e060..34759dc93d7c 100644 --- a/core/modules/config_translation/src/FormElement/Textfield.php +++ b/core/modules/config_translation/src/FormElement/Textfield.php @@ -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), ); } -- GitLab