"Invalid translation language (und) specified" when creating/updating translations

Created on 17 March 2023, over 1 year ago
Updated 9 July 2024, 2 months ago

Problem/Motivation

When publishing a translation to a Drupal instance, the following error appears:

Drupal\Core\Entity\EntityStorageException: Invalid translation language (und) specified. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 815 of /var/web/vd22308/deploy/releases/20230315083834/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

Steps to reproduce

  1. Create a new story in StoryChief and publish it to your Drupal instance
  2. Create a translation of the new story in StoryChief and publish it to your Drupal instance

Proposed resolution

The error is caused by the content_translation_source field not being set. This usually happens in \Drupal\content_translation\Controller\ContentTranslationController::prepareTranslation(), which is only called when translating content through the UI.

🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇧🇪Belgium DieterHolvoet Brussels

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

Comments & Activities

Production build 0.71.5 2024