Add mapper and translation language information to $form_state in Drupal\config_translation\Form\ConfigTranslationDeleteForm

Created on 6 January 2021, over 3 years ago
Updated 2 February 2023, over 1 year ago

Problem/Motivation

When a configuration translation is added or edited, $form_state contains helpful information about:

  • config_translation_mapper: the translation mapper being used.
  • config_translation_language: the translation language.
  • config_translation_source_language: the translation source language.

The above data is set in Drupal\config_translation\Form\ConfigTranslationFormBase, in lines 157-160:

    // Add some information to the form state for easier form altering.
    $form_state->set('config_translation_mapper', $this->mapper);
    $form_state->set('config_translation_language', $this->language);
    $form_state->set('config_translation_source_language', $this->sourceLanguage);

This helpful information is available ONLY when adding or editing a configuration translation, BUT not when deleting it. That information is missing in Drupal\config_translation\Form\ConfigTranslationDeleteForm.

I think the same $form_state information should be provided for all CRUD operations, and not only for adding or editing operations.

Proposed resolution

Add the aforementioned information to the form state in Drupal\config_translation\Form\ConfigTranslationDeleteForm.

✨ Feature request
Status

Needs work

Version

10.1 ✨

Component
Config translationΒ  β†’

Last updated about 1 month ago

Created by

πŸ‡ͺπŸ‡ΈSpain albertosilva Basque Country

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024