function ConfigTranslationTestHooks::formConfigTranslationEditFormAlter

Implements hook_form_FORM_ID_alter() for ConfigTranslationEditForm.

Adds a column to the configuration translation edit form that shows the current translation. Note that this column would not be displayed by default, as the columns are hardcoded in config_translation_manage_form_element.html.twig. The template would need to be overridden for the column to be displayed.

See also

\Drupal\config_translation\Form\ConfigTranslationEditForm

File

core/modules/config_translation/tests/modules/config_translation_test/src/Hook/ConfigTranslationTestHooks.php, line 90

Class

ConfigTranslationTestHooks
Hook implementations for config_translation_test.

Namespace

Drupal\config_translation_test\Hook

Code

public function formConfigTranslationEditFormAlter(&$form, FormStateInterface $form_state) : void {
    if (\Drupal::state()->get('config_translation_test_alter_form_alter')) {
        $form['#altered'] = TRUE;
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.