Invalid translation language (de) specified. in Drupal\Core\Entity\ContentEntityBase->addTranslation()

Created on 27 February 2024, 4 months ago
Updated 29 February 2024, 4 months ago

Problem/Motivation

Adding a new translation apart from the default one results in an ajax error

InvalidArgumentException: Invalid translation language (de) specified. in Drupal\Core\Entity\ContentEntityBase->addTranslation() (line 985 of /var/www/html/releases/1/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php).

In the past, this error was "only" in the log but not in the UI. After installing the gin theme the ajax issues are also visible to the UI.

After removing the Real time SEO field from the form display, the error is gone.

The problem seems to be that the route "pl/node/507/translations/add/en/pl" (for a new pl translation for example) is called synchronously by saving the new translation and after that the ajax call of this module takes place calling the same route again and therefor the exception is thrown because a translation for this language does already exist at this time.

Does anyone have an idea?

🐛 Bug report
Status

Active

Component

Code

Created by

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

Comments & Activities

Production build 0.69.0 2024