Undefined array key "processedTranslations" in Drupal\ai_translate\Controller\AiTranslateController->insertTranslation

Created on 22 April 2025, 17 days ago

Problem/Motivation

The array key 'processedTranslations' is only set on successful translation in \Drupal\ai_translate\Controller\AiTranslateController::translateSingleText, yet it is always used in \Drupal\ai_translate\Controller\AiTranslateController::insertTranslation, cause the translation batch to crash.

Steps to reproduce

Try translating using an API (key) that will be rejected for some reason (rate limit exceeded, no funds, ...).

Proposed resolution

Passing an empty array if 'processedTranslations' does not exists seems the easiest fix.
No upstream or downstream code changes required that way.

🐛 Bug report
Status

Active

Version

1.1

Component

Other Submodules

Created by

🇧🇪Belgium andreasderijcke Antwerpen / Gent

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