Error: Attempt to assign property "moderation_state" on null in Drupal\content_moderation\Entity\ContentModerationState->save() (line 165

Created on 28 August 2022, about 2 years ago
Updated 6 October 2022, about 2 years ago

I enabled and use the content moderation core module. When import a whole site content tar file, it shows as below:
Synchronizing Content...
An error has occurred.
Please continue to the error page

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /batch?id=4&op=do_nojs&op=do
StatusText: OK
ResponseText:

And there is a log in the recent log messages:

Error: Attempt to assign property "moderation_state" on null in Drupal\content_moderation\Entity\ContentModerationState->save() (line 165 of /var/www/drupal9/web/core/modules/content_moderation/src/Entity/ContentModerationState.php)
#0 /var/www/drupal9/web/modules/contrib/content_sync/src/Importer/ContentImporter.php(187): Drupal\content_moderation\Entity\ContentModerationState->save()
#1 /var/www/drupal9/web/modules/contrib/content_sync/src/Importer/ContentImporter.php(77): Drupal\content_sync\Importer\ContentImporter->syncEntity()
#2 /var/www/drupal9/web/modules/contrib/content_sync/src/Form/ContentImportTrait.php(70): Drupal\content_sync\Importer\ContentImporter->importEntity()
#3 /var/www/drupal9/web/core/includes/batch.inc(295): Drupal\content_sync\Form\ContentSync->syncContent()
#4 /var/www/drupal9/web/core/includes/batch.inc(137): _batch_process()
#5 /var/www/drupal9/web/core/includes/batch.inc(93): _batch_do()
#6 /var/www/drupal9/web/core/modules/system/src/Controller/BatchController.php(55): _batch_page()
#7 [internal function]: Drupal\system\Controller\BatchController->batchPage()
#8 /var/www/drupal9/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#9 /var/www/drupal9/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#10 /var/www/drupal9/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#11 /var/www/drupal9/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#12 /var/www/drupal9/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#13 /var/www/drupal9/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#14 /var/www/drupal9/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#15 /var/www/drupal9/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#16 /var/www/drupal9/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#17 /var/www/drupal9/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#18 /var/www/drupal9/vendor/asm89/stack-cors/src/Asm89/Stack/Cors.php(49): Drupal\page_cache\StackMiddleware\PageCache->handle()
#19 /var/www/drupal9/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Asm89\Stack\Cors->handle()
#20 /var/www/drupal9/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#21 /var/www/drupal9/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#22 /var/www/drupal9/web/core/lib/Drupal/Core/DrupalKernel.php(709): Stack\StackedHttpKernel->handle()
#23 /var/www/drupal9/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#24 {main}
πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡¨πŸ‡³China fishfree

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