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.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

super_romeo created an issue. See original summary.

super_romeo’s picture

Issue summary: View changes

fishfree made their first commit to this issue’s fork.

eadamse’s picture

Assumes the intention is to evaluate if more than one user is in the list context for the VBO cancel action when attempting to delete the user's own account. This fix does not directly relate to if the user is the admin per the original issue description, but does make sure a user can in fact proceed to delete their own account if other conditions are met.

eadamse’s picture

Status: Active » Needs review
super_romeo’s picture

Patch #4 looks good to me.

graber’s picture

Status: Needs review » Reviewed & tested by the community

Good spot!

  • Graber committed 32c29f66 on 4.2.x
    Issue #3300190 by eadamse, fishfree, super_romeo: TypeError: count():...
graber’s picture

Status: Reviewed & tested by the community » Fixed

Now why didn't I commit this? Something must've distracted me.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.