diff --git a/core/modules/config_translation/lib/Drupal/config_translation/FormElement/TextFormat.php b/core/modules/config_translation/lib/Drupal/config_translation/FormElement/TextFormat.php index 534b2dc..4b5d14a 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/FormElement/TextFormat.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/FormElement/TextFormat.php @@ -32,11 +32,21 @@ public function getTranslationElement(array $definition, LanguageInterface $lang */ public function getSourceElement(array $definition, LanguageInterface $source_language, $base_config) { // Instead of the formatted output show a disabled textarea. This allows for - // easier side-by-side comparison, especially with for formats with text + // easier side-by-side comparison, especially with formats with text // editors. - return $this->getTranslationElement($definition, $source_language, $base_config) + array( + $element = $this->getTranslationElement($definition, $source_language, $base_config) + array( + '#value' => $base_config['value'], '#disabled' => TRUE, + '#allow_focus' => TRUE, ); + // Because #input is set to FALSE in + // ConfigTranslationFormBase::buildConfigForm(), + // FormBuilder::handleInputElement() is not called on this element. + // Therefore we need to set the appropriate attribute manually. + $element['#attributes']['readonly'] = 'readonly'; + // @todo CKEditor does not support the 'readonly' attribute. + $element['#attributes']['disabled'] = 'disabled'; + return $element; } } diff --git a/core/modules/config_translation/tests/modules/config_translation_test/config_translation_test.local_tasks.yml b/core/modules/config_translation/tests/modules/config_translation_test/config_translation_test.local_tasks.yml new file mode 100644 index 0000000..92581b4 --- /dev/null +++ b/core/modules/config_translation/tests/modules/config_translation_test/config_translation_test.local_tasks.yml @@ -0,0 +1,7 @@ +# Add a default local task for the file system settings page, so that the local +# task added by Configuration Translation becomes visible. This facilitates +# manual testing. +system.file_system_settings: + route_name: system.file_system_settings + title: Settings + base_route: system.file_system_settings diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module index 9da1540..dcf85d6 100644 --- a/core/modules/editor/editor.module +++ b/core/modules/editor/editor.module @@ -257,9 +257,8 @@ function editor_pre_render_format($element) { } // filter_process_format() copies properties to the expanded 'value' child - // element. Skip this text format widget, if it contains no 'format' or when - // the current user does not have access to edit the value. - if (!isset($element['format']) || !empty($element['value']['#disabled'])) { + // element. Skip this text format widget, if it contains no 'format'. + if (!isset($element['format'])) { return $element; } $format_ids = array_keys($element['format']['format']['#options']);