Incorrect Translation Status Displayed on AI Translate Page Due to Outdated Entity Retrieval

Created on 18 October 2024, 2 months ago

Problem/Motivation

The translation status of the node is somethies not correct in translate page of a node.
Somethimes, i get the "translate using ai" even if the content is translated.
And somethimes i dont get it when i should be able to translate.

It seems the issue is located in /ai/modules/ai_translate/src/Form/AiTranslateForm.php : Line 110
https://git.drupalcode.org/project/ai/-/blob/1.0.x/modules/ai_translate/...

The $entity->hasTranslation($langcode) do not send the right value.

Steps to reproduce

Not sure what cause the issue.

Proposed resolution

Make sure that we get the last value of the entity by loading it by id :

    $entity = $this->entityTypeManager->getStorage($entity_type)->load($entity_id);

Would be better to find why the value is not correct at the first place.

🐛 Bug report
Status

Active

Version

1.0

Component

Other Submodules

Created by

🇧🇪Belgium arwillame

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024