Paragraphs with translateable image fields cause translation-jobs to fail

Created on 13 January 2025, 3 months ago

Problem/Motivation

After updating to version 1.17, the following behaviour can be observed:

Translation-jobs can't be completed if a paragraph with an image field is part of the job. (Only alt and title are configured as translatable.) Image fields which are placed directly on nodes don't produce that error.
The job fails after the review form is submited. Following error message can be found in the error Log:

Message:
Drupal\Core\Entity\EntityStorageException: Invalid translation language (fr) specified. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (Zeile 817 in /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

Backtrace:
#0 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/Entity/EntityBase.php(354): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()
#1 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/modules/contrib/entity_reference_revisions/src/Plugin/Field/FieldType/EntityReferenceRevisionsItem.php(310): Drupal\Core\Entity\EntityBase->save()
#2 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/Field/FieldItemList.php(233): Drupal\entity_reference_revisions\Plugin\Field\FieldType\EntityReferenceRevisionsItem->preSave()
#3 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/Field/FieldItemList.php(191): Drupal\Core\Field\FieldItemList->delegateMethod()
#4 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(938): Drupal\Core\Field\FieldItemList->preSave()
#5 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(888): Drupal\Core\Entity\ContentEntityStorageBase->invokeFieldMethod()
#6 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(529): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook()
#7 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(753): Drupal\Core\Entity\EntityStorageBase->doPreSave()
#8 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(483): Drupal\Core\Entity\ContentEntityStorageBase->doPreSave()
#9 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(806): Drupal\Core\Entity\EntityStorageBase->save()
#10 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/Entity/EntityBase.php(354): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()
#11 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/modules/contrib/tmgmt/sources/content/src/Plugin/tmgmt/Source/ContentEntitySource.php(628): Drupal\Core\Entity\EntityBase->save()
#12 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/modules/contrib/tmgmt/sources/content/src/Plugin/tmgmt/Source/ContentEntitySource.php(405): Drupal\tmgmt_content\Plugin\tmgmt\Source\ContentEntitySource->doSaveTranslations()
#13 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/modules/contrib/tmgmt/src/Entity/JobItem.php(890): Drupal\tmgmt_content\Plugin\tmgmt\Source\ContentEntitySource->saveTranslation()
#14 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/modules/contrib/tmgmt/src/Form/JobItemForm.php(377): Drupal\tmgmt\Entity\JobItem->acceptTranslation()
#15 [internal function]: Drupal\tmgmt\Form\JobItemForm->save()
#16 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/Form/FormSubmitter.php(129): call_user_func_array()
#17 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/Form/FormSubmitter.php(67): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers()
#18 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/Form/FormBuilder.php(597): Drupal\Core\Form\FormSubmitter->doSubmitForm()
#19 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/Form/FormBuilder.php(326): Drupal\Core\Form\FormBuilder->processForm()
#20 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#21 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/modules/layout_builder/src/Controller/LayoutBuilderHtmlEntityFormController.php(39): Drupal\Core\Controller\FormController->getContentResult()
#22 [internal function]: Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult()
#23 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#24 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#25 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
#26 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#27 /var/www/vhosts/domain.tld/httpdocs/domain.tld/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#28 /var/www/vhosts/domain.tld/httpdocs/domain.tld/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#29 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#30 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#31 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#32 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#33 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#34 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass()
#35 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#36 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#37 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#38 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#39 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#40 /var/www/vhosts/domain.tld/httpdocs/domain.tld/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#41 {main}

Steps to reproduce

1. Create a Paragraph type with a image field.
2. Configure the pargaraph and its image field (alt, title) to be translateable.
3. Create a Node type with a paragraph reference field.
4. Configure the Node to be translateable
5. Create a node with paragraph attached, uploade a file to the image field.
6. Translate the node with tmgmt.
7. Try to submit the review form.

🐛 Bug report
Status

Active

Version

1.17

Component

Source: Node

Created by

🇨🇭Switzerland gemisky

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

Comments & Activities

  • Issue created by @gemisky
  • 🇪🇸Spain ipitbiz

    I am having the same error and it is due to this change in version 1.17:

    #3478739 by berdir: Create revision before changing values, set revision author and time

    If I leave the creation of a revision as it was in 1.16, version 1.17 works fine.

    Specifically, the problem is on line 507:

    $translation = $storage->createRevision($translation, $translation->isDefaultRevision());

    Leaving the previous line, the one that updated the $entity variable works:

    $entity = $storage->createRevision($entity, $entity->isDefaultRevision());

  • 🇪🇸Spain ipitbiz

    I add this patch that fixes the problem.

Production build 0.71.5 2024