TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in count() (line 94 of CancelUserAction.php)

Created on 27 July 2022, over 2 years ago
Updated 21 May 2024, 7 months ago

Error after I tried accidently delete admin user:

TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in count() (line 94 of /DATA/home-sites/lom/web/modules/contrib/views_bulk_operations/src/Plugin/Action/CancelUserAction.php)
#0 /DATA/home-sites/lom/web/modules/contrib/views_bulk_operations/src/Plugin/Action/CancelUserAction.php(94): count(true)
#1 /DATA/home-sites/lom/web/modules/contrib/views_bulk_operations/src/Action/ViewsBulkOperationsActionBase.php(116): Drupal\views_bulk_operations\Plugin\Action\CancelUserAction->execute(Object(Drupal\user\Entity\User))
#2 /DATA/home-sites/lom/web/modules/contrib/views_bulk_operations/src/Service/ViewsBulkOperationsActionProcessor.php(483): Drupal\views_bulk_operations\Action\ViewsBulkOperationsActionBase->executeMultiple(Array)
#3 /DATA/home-sites/lom/web/modules/contrib/views_bulk_operations/src/ViewsBulkOperationsBatch.php(106): Drupal\views_bulk_operations\Service\ViewsBulkOperationsActionProcessor->process()
#4 /DATA/home-sites/lom/web/core/includes/batch.inc(295): Drupal\views_bulk_operations\ViewsBulkOperationsBatch::operation(Array, Array)
#5 /DATA/home-sites/lom/web/core/includes/batch.inc(137): _batch_process()
#6 /DATA/home-sites/lom/web/core/includes/batch.inc(93): _batch_do()
#7 /DATA/home-sites/lom/web/core/modules/system/src/Controller/BatchController.php(55): _batch_page(Object(Symfony\Component\HttpFoundation\Request))
#8 [internal function]: Drupal\system\Controller\BatchController->batchPage(Object(Symfony\Component\HttpFoundation\Request))
#9 /DATA/home-sites/lom/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#10 /DATA/home-sites/lom/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#11 /DATA/home-sites/lom/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#12 /DATA/home-sites/lom/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#13 /DATA/home-sites/lom/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#14 /DATA/home-sites/lom/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#15 /DATA/home-sites/lom/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /DATA/home-sites/lom/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /DATA/home-sites/lom/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /DATA/home-sites/lom/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /DATA/home-sites/lom/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /DATA/home-sites/lom/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /DATA/home-sites/lom/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /DATA/home-sites/lom/web/core/lib/Drupal/Core/DrupalKernel.php(709): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /DATA/home-sites/lom/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#24 {main}
.

I guess there is should be just warning message, not fatal error.

🐛 Bug report
Status

Fixed

Version

4.1

Component

Core

Created by

🇷🇸Serbia super_romeo Belgrade

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