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
- Create a new story in StoryChief and publish it to your Drupal instance
- 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
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:
- 3348690-invalid-translation-language
changes, plain diff MR !7
Comments
Comment #3
dieterholvoet commentedComment #4
dieterholvoet commentedI was able to fix #3355307: Invalid translation language (fr-BE) specified as well by moving the new getTranslation method to
StoryChiefRemoteCallEventSubscriberBaseand also using it inStoryChiefRemoteCallUpdateEventSubscriber.Comment #5
dieterholvoet commentedComment #6
dieterholvoet commentedComment #7
dieterholvoet commentedComment #8
gregory claeyssens commentedComment #9
gregory claeyssens commented