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.

Issue fork storychief-3348690

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

DieterHolvoet created an issue. See original summary.

dieterholvoet’s picture

Status: Active » Needs review
dieterholvoet’s picture

I was able to fix #3355307: Invalid translation language (fr-BE) specified as well by moving the new getTranslation method to StoryChiefRemoteCallEventSubscriberBase and also using it in StoryChiefRemoteCallUpdateEventSubscriber.

dieterholvoet’s picture

Title: "Invalid translation language (und) specified" when creating translations » "Invalid translation language (und) specified" when creating/updating translations
dieterholvoet’s picture

dieterholvoet’s picture

gregory claeyssens’s picture

Status: Needs review » Fixed
gregory claeyssens’s picture

Status: Fixed » Closed (fixed)