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

Created on 6 January 2021, over 4 years ago
Updated 2 February 2023, over 2 years 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 2 hours 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.

  • 🇺🇸United States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

    Did not test

    But this will need a test case to cover this feature.

Production build 0.71.5 2024