[AI Translate] Module uses Form that isn't a form

Created on 3 January 2025, 3 months ago

Problem/Motivation

The AI translate module uses Drupal\ai_translate\Form\AiTranslateForm::buildForm() to add information to the build array created by the Content Translation controller to allow users to manage AI translations. It isn't clear why this is done as a form, as it isn't accessed by directly at any point and does not use any of the traditional form methods (validate, submit, etc).

The form also alters the table generated by the parent controller to be a tableselect element, but does not have any submit functionality, meaning the checkboxes added by this element have no functionality.

Proposed resolution

The form should be removed, and the altering of the parent table build should be done directly in Drupal\ai_translate\Controller\ContentTranslationControllerOverride::overview(). This should not create a tableselect element unless there is some purpose for it.

If may be worth waiting for https://www.drupal.org/project/ai/issues/3480861 🐛 "Translate with AI" Button Not Appearing Due to Route Alteration Conflict with Other Modules Active to be merged first as this will alter the form code.

📌 Task
Status

Active

Version

1.0

Component

Other Submodules

Created by

🇬🇧United Kingdom MrDaleSmith

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024