diff --git a/core/modules/config_translation/config_translation.module b/core/modules/config_translation/config_translation.module index 621804a..f8b5482 100644 --- a/core/modules/config_translation/config_translation.module +++ b/core/modules/config_translation/config_translation.module @@ -194,8 +194,8 @@ function config_translation_config_schema_info_alter(&$definitions) { // form elements in ConfigTranslationFormBase. Other translatable types will // appear as a one line textfield. foreach ($definitions as $type => &$definition) { - if (!isset($definition['form_element_class']) && isset($map[$definition['type']])) { - $definition['form_element_class'] = $map[$definition['type']]; + if (!isset($definition['form_element_class']) && isset($map[$type])) { + $definition['form_element_class'] = $map[$type]; } } } diff --git a/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php b/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php index 4b7213e..756dae1 100644 --- a/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php +++ b/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php @@ -42,10 +42,6 @@ protected $configMapperManager; /** - * - */ - - /** * The mapper for configuration translation. * * @var \Drupal\config_translation\ConfigMapperInterface @@ -247,8 +243,8 @@ public function submitForm(array &$form, FormStateInterface $form_state) { * (optional) Whether or not the details element of the form should be open. * Defaults to TRUE. * @param string|null $base_key - * (optional) The base key that the schema and the configuration values - * belong to. This should be NULL for the top-level configuration object and + * (optional) The base key to which the schema and configuration values + * belong. This should be NULL for the top-level configuration object and * be populated consecutively when recursing into the configuration * structure. * @@ -264,13 +260,6 @@ protected function buildConfigForm($name, ArrayElement $schema, $source_config, if (!$definition->getLabel()) { $definition->setLabel($this->t('N/A')); } - // Invoke hook_config_translation_type_info_alter() implementations to - // alter the configuration types. - $definitions = array( - $definition['type'] => &$definition, - ); - - $this->moduleHandler->alter('config_translation_type_info', $definitions); // If this element is translatable, show a translation form. This may be a // simple element, as is the case for unformatted text or date formats, or @@ -278,6 +267,10 @@ protected function buildConfigForm($name, ArrayElement $schema, $source_config, // the form element class is responsible for handling input for all // configuration values contained in the element. if (!empty($definition['translatable'])) { + if (!isset($definition['form_element_class'])) { + $this->logger('config_translation')->notice("No form element class exists for config schema defintion '@name'", array('@name', $definition->getLabel())); + continue; + } /** @var \Drupal\config_translation\FormElement\ElementInterface $form_element */ $form_element = new $definition['form_element_class']($definition);