"TypeError:count(): Argument #1 ($value) must be of type Countable|array, bool given" when adding webform analysis block

Created on 25 July 2022, over 2 years ago
Updated 18 August 2023, over 1 year ago

When placing blocks "Webform Analysis" and "Webform Node Analysis" on page /admin/structure/block/list/olivero, it shows error as below:

TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in count() (line 94 of /var/www/mysite/web/modules/contrib/webform_analysis/src/Plugin/Block/WebformAnalysisBlock.php)
#0 /var/www/mysite/web/modules/contrib/webform_analysis/src/Plugin/Block/WebformAnalysisBlock.php(94): count()
#1 /var/www/mysite/web/core/lib/Drupal/Core/Block/BlockPluginTrait.php(188): Drupal\webform_analysis\Plugin\Block\WebformAnalysisBlock->blockForm()
#2 /var/www/mysite/web/core/lib/Drupal/Core/Block/BlockBase.php(35): Drupal\Core\Block\BlockBase->traitBuildConfigurationForm()
#3 /var/www/mysite/web/core/modules/block/src/BlockForm.php(128): Drupal\Core\Block\BlockBase->buildConfigurationForm()
#4 /var/www/mysite/web/core/lib/Drupal/Core/Entity/EntityForm.php(106): Drupal\block\BlockForm->form()
#5 [internal function]: Drupal\Core\Entity\EntityForm->buildForm()
#6 /var/www/mysite/web/core/lib/Drupal/Core/Form/FormBuilder.php(531): call_user_func_array()
#7 /var/www/mysite/web/core/lib/Drupal/Core/Form/FormBuilder.php(278): Drupal\Core\Form\FormBuilder->retrieveForm()
#8 /var/www/mysite/web/core/lib/Drupal/Core/Entity/EntityFormBuilder.php(48): Drupal\Core\Form\FormBuilder->buildForm()
#9 /var/www/mysite/web/core/modules/block/src/Controller/BlockAddController.php(27): Drupal\Core\Entity\EntityFormBuilder->getForm()
#10 [internal function]: Drupal\block\Controller\BlockAddController->blockAddConfigureForm()
#11 /var/www/mysite/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#12 /var/www/mysite/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#13 /var/www/mysite/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#14 /var/www/mysite/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#15 /var/www/mysite/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#16 /var/www/mysite/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#17 /var/www/mysite/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#18 /var/www/mysite/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#19 /var/www/mysite/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#20 /var/www/mysite/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#21 /var/www/mysite/vendor/asm89/stack-cors/src/Asm89/Stack/Cors.php(49): Drupal\page_cache\StackMiddleware\PageCache->handle()
#22 /var/www/mysite/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Asm89\Stack\Cors->handle()
#23 /var/www/mysite/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#24 /var/www/mysite/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#25 /var/www/mysite/web/core/lib/Drupal/Core/DrupalKernel.php(709): Stack\StackedHttpKernel->handle()
#26 /var/www/mysite/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#27 {main}

Drupal: 9.4.3, PHP: 8.1.8

🐛 Bug report
Status

Fixed

Version

1.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