diff --git a/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php b/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php index c4dfa10..9e5372f 100644 --- a/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php +++ b/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php @@ -176,9 +176,6 @@ public function buildForm(array $form, FormStateInterface $form_state, Request $ if ($form_element = $this->createFormElement($schema)) { $parents = array('config_names', $name); $form['config_names'][$name] += $form_element->getTranslationBuild($this->sourceLanguage, $this->language, $source_config, $translation_config, $parents); - if ($attributes = $form_element->getFormAttributes()) { - $form = array_merge_recursive($form, $attributes); - } } } diff --git a/core/modules/config_translation/src/FormElement/DateFormat.php b/core/modules/config_translation/src/FormElement/DateFormat.php index cc96f0f..db291f7 100644 --- a/core/modules/config_translation/src/FormElement/DateFormat.php +++ b/core/modules/config_translation/src/FormElement/DateFormat.php @@ -31,16 +31,10 @@ public function getTranslationElement(LanguageInterface $translation_language, $ 'data-drupal-date-formatter' => 'source', ], '#attached' => [ - 'drupalSettings' => array('dateFormats' => $date_formatter->getSampleDateFormats($translation_language->getId())), + 'drupalSettings' => ['dateFormats' => $date_formatter->getSampleDateFormats($translation_language->getId())], + 'library' => ['system/drupal.system.date'], ], ] + parent::getTranslationElement($translation_language, $source_config, $translation_config); } - /** - * {@inheritdoc} - */ - public function getFormAttributes() { - return ['#attached' => ['library' => ['system/drupal.system.date']]]; - } - } diff --git a/core/modules/config_translation/src/FormElement/ElementInterface.php b/core/modules/config_translation/src/FormElement/ElementInterface.php index c9fb0b9..286eeba 100644 --- a/core/modules/config_translation/src/FormElement/ElementInterface.php +++ b/core/modules/config_translation/src/FormElement/ElementInterface.php @@ -70,12 +70,4 @@ public function getTranslationBuild(LanguageInterface $source_language, Language */ public function setConfig(Config $base_config, LanguageConfigOverride $config_translation, $config_values, $base_key = NULL); - /** - * Allows to provide form attributes for the configuration form. - * - * @return array - * An array of form attributes. - */ - public function getFormAttributes(); - } diff --git a/core/modules/config_translation/src/FormElement/FormElementBase.php b/core/modules/config_translation/src/FormElement/FormElementBase.php index ef76ef4..e13cc31 100644 --- a/core/modules/config_translation/src/FormElement/FormElementBase.php +++ b/core/modules/config_translation/src/FormElement/FormElementBase.php @@ -75,13 +75,6 @@ public function getTranslationBuild(LanguageInterface $source_language, Language } /** - * {@inheritdoc} - */ - public function getFormAttributes() { - return []; - } - - /** * Returns the source element for a given configuration definition. * * This can be either a render array that actually outputs the source values diff --git a/core/modules/config_translation/src/FormElement/ListElement.php b/core/modules/config_translation/src/FormElement/ListElement.php index 4723203..9365fc2 100644 --- a/core/modules/config_translation/src/FormElement/ListElement.php +++ b/core/modules/config_translation/src/FormElement/ListElement.php @@ -97,23 +97,6 @@ public function setConfig(Config $base_config, LanguageConfigOverride $config_tr } /** - * {@inheritdoc} - */ - public function getFormAttributes() { - $attributes = []; - foreach ($this->element as $key => $element) { - if ($form_element = ConfigTranslationFormBase::createFormElement($element)) { - $form_attributes = $form_element->getFormAttributes(); - if (empty($form_attributes)) { - continue; - } - $attributes += $form_attributes; - } - } - return $attributes; - } - - /** * Returns the title for the 'details' element of a group of schema elements. * * For some configuration elements the same element structure can be repeated