Problem/Motivation

When adding Icelandic (and other) language translations, the site breaks and displays the following error. There are also different paragraph blocks on the page, and all fields inside paragraphs have "Users may translate this field" enabled.
here is the stack tree.

TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in count() (line 213 of /var/www/project/qa4/application/docroot/core/modules/content_translation/src/FieldTranslationSynchronizer.php)
#0 /var/www/project/qa4/application/docroot/core/modules/content_translation/src/FieldTranslationSynchronizer.php(213): count(NULL)
#1 /var/www/project/qa4/application/docroot/core/modules/content_translation/src/FieldTranslationSynchronizer.php(171): Drupal\content_translation\FieldTranslationSynchronizer->synchronizeItems(Array, Array, 'is', Array, Array)
#2 /var/www/project/qa4/application/docroot/core/modules/content_translation/content_translation.module(531): Drupal\content_translation\FieldTranslationSynchronizer->synchronizeFields(Object(Drupal\paragraphs\Entity\Paragraph), 'is', NULL)
#3 [internal function]: content_translation_entity_presave(Object(Drupal\paragraphs\Entity\Paragraph))
#4 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array(Object(Closure), Array)
#5 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object(Closure), 'content_transla...')
#6 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith('entity_presave', Object(Closure))
#7 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(251): Drupal\Core\Extension\ModuleHandler->invokeAll('entity_presave', Array)
#8 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(903): Drupal\Core\Entity\EntityStorageBase->invokeHook('presave', Object(Drupal\paragraphs\Entity\Paragraph))
#9 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(563): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('presave', Object(Drupal\paragraphs\Entity\Paragraph))
#10 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(756): Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\paragraphs\Entity\Paragraph))
#11 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(517): Drupal\Core\Entity\ContentEntityStorageBase->doPreSave(Object(Drupal\paragraphs\Entity\Paragraph))
#12 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(802): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\paragraphs\Entity\Paragraph))
#13 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Entity/EntityBase.php(339): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object(Drupal\paragraphs\Entity\Paragraph))
#14 /var/www/project/qa4/application/docroot/modules/contrib/entity_reference_revisions/src/Plugin/Field/FieldType/EntityReferenceRevisionsItem.php(310): Drupal\Core\Entity\EntityBase->save()
#15 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Field/FieldItemList.php(233): Drupal\entity_reference_revisions\Plugin\Field\FieldType\EntityReferenceRevisionsItem->preSave()
#16 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Field/FieldItemList.php(191): Drupal\Core\Field\FieldItemList->delegateMethod('preSave')
#17 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(941): Drupal\Core\Field\FieldItemList->preSave()
#18 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(891): Drupal\Core\Entity\ContentEntityStorageBase->invokeFieldMethod('preSave', Object(Drupal\node\Entity\Node))
#19 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(563): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('presave', Object(Drupal\node\Entity\Node))
#20 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(756): Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\node\Entity\Node))
#21 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(517): Drupal\Core\Entity\ContentEntityStorageBase->doPreSave(Object(Drupal\node\Entity\Node))
#22 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(802): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\node\Entity\Node))
#23 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Entity/EntityBase.php(339): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object(Drupal\node\Entity\Node))
#24 /var/www/project/qa4/application/docroot/core/modules/node/src/NodeForm.php(270): Drupal\Core\Entity\EntityBase->save()
#25 [internal function]: Drupal\node\NodeForm->save(Array, Object(Drupal\Core\Form\FormState))
#26 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Form/FormSubmitter.php(114): call_user_func_array(Array, Array)
#27 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Form/FormSubmitter.php(52): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#28 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(592): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState))
#29 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(320): Drupal\Core\Form\FormBuilder->processForm('node_localized_...', Array, Object(Drupal\Core\Form\FormState))
#30 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Entity/EntityFormBuilder.php(48): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\node\NodeForm), Object(Drupal\Core\Form\FormState))
#31 /var/www/project/qa4/application/docroot/core/modules/content_translation/src/Controller/ContentTranslationController.php(394): Drupal\Core\Entity\EntityFormBuilder->getForm(Object(Drupal\node\Entity\Node), 'default', Array)
#32 [internal function]: Drupal\content_translation\Controller\ContentTranslationController->add(Object(Drupal\Core\Language\Language), Object(Drupal\Core\Language\Language), Object(Drupal\Core\Routing\RouteMatch), 'node')
#33 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#34 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#35 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#36 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#37 /var/www/project/qa4/application/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#38 /var/www/project/qa4/application/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#39 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#40 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#41 /var/www/project/qa4/application/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#42 /var/www/project/qa4/application/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#43 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#44 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#45 /var/www/project/qa4/application/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#46 /var/www/project/qa4/application/docroot/core/lib/Drupal/Core/DrupalKernel.php(709): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#47 /var/www/project/qa4/application/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#48 {main}

Steps to reproduce

Proposed resolution

NA

Remaining tasks

User interface changes

NA

API changes

Data model changes

Release notes snippet

Comments

Gauravvvv created an issue. See original summary.

gauravvvv’s picture

Title: Content translation: Site breaks on adding new language content » Content translation: Site breaks on adding content translations
Component: config_translation.module » content_translation.module
gauravvvv’s picture

Version: 11.x-dev » 9.4.x-dev
Issue summary: View changes
gauravvvv’s picture

Issue summary: View changes
cilefen’s picture

Status: Active » Postponed (maintainer needs more info)

Drupal 9 is end-of-life and not supported.

gauravvvv’s picture

Issue summary: View changes
pameeela’s picture

@Gauravvvv can you reproduce this in Drupal 10 or 11? If not, this issue will be closed as 9 is no longer supported.

If no info is provided within three months, this issue may be closed.

quietone’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)
Issue tags: +Bug Smash Initiative

Since we need more information to move forward with this issue, and it has not been supplied and DRupal 9 is EOL. I am closing this issue.

If you are experiencing this problem on a supported version of Drupal reopen the issue, by setting the status to 'Active', updating the Version and and providing complete steps to reproduce the issue (starting from "Install Drupal core").

Thanks!