Drupal\Core\Entity\EntityStorageException: The default translation flag cannot be changed (de)

Created on 8 August 2022, almost 3 years ago
Updated 3 June 2025, about 1 month ago

Hi team,

When we try editing the node/page on the web pages, we get the below error message.

"The website encountered an unexpected error. Please try again later.

Drupal\Core\Entity\EntityStorageException: The default translation flag cannot be changed (de). in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 811 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

LogicException: The default translation flag cannot be changed (de). in Drupal\Core\Entity\ContentEntityBase->onChange() (line 833 of /var/www/docroot/core/lib/Drupal/Core/Entity/ContentEntityBase.php).

We are using the layout builder and are unable to edit/ make any changes to this page.

Steps
Edit the page -> make any changes -> click on the Save button.

The website encountered an unexpected error. Please try again later. Drupal\Core\Entity\EntityStorageException: The default translation flag cannot be changed (de). in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 811 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php). Drupal\Core\Entity\Plugin\DataType\EntityAdapter->onChange('default_langcode') (Line: 80) Drupal\Core\TypedData\Plugin\DataType\ItemList->setValue(Array, 1) (Line: 107) Drupal\Core\Field\FieldItemList->setValue(Array, 1) (Line: 628) Drupal\Core\Entity\ContentEntityBase->set('default_langcode', Array) (Line: 414) Drupal\Core\Entity\ContentEntityStorageBase->createRevision(Object, ) (Line: 203) Drupal\content_moderation\EntityOperations->updateOrCreateFromEntity(Object) (Line: 149) Drupal\content_moderation\EntityOperations->entityUpdate(Object) (Line: 122) content_moderation_entity_update(Object) call_user_func_array('content_moderation_entity_update', Array) (Line: 403) Drupal\Core\Extension\ModuleHandler->invokeAll('entity_update', Array) (Line: 251) Drupal\Core\Entity\EntityStorageBase->invokeHook('update', Object) (Line: 899) Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('update', Object) (Line: 602) Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, 1) (Line: 784) Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, 1) (Line: 527) Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 802) Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 339) Drupal\Core\Entity\EntityBase->save() (Line: 270) Drupal\node\NodeForm->save(Array, Object) call_user_func_array(Array, Array) (Line: 114) Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52) Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 592) Drupal\Core\Form\FormBuilder->processForm('node_page_edit_form', Array, Object) (Line: 320) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73) Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39) Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50) Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 265) Drupal\shield\ShieldMiddleware->bypass(Object, 1, 1) (Line: 132) Drupal\shield\ShieldMiddleware->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 49) Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle(Object, 1, 1) (Line: 23) Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

๐Ÿ› Bug report
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component

content_moderation.module

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia divya.pm

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024