BEF php 8.1.2 / TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given

Created on 2 July 2022, over 2 years ago
Updated 5 June 2024, 6 months ago

Problem/Motivation

The website encountered an unexpected error. Please try again later.
TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in count() (line 62 of core/lib/Drupal/Core/Render/Element/Radios.php).

count() (Line: 62)
Drupal\Core\Render\Element\Radios::processRadios()
call_user_func_array() (Line: 1007)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1070)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 574)
Drupal\Core\Form\FormBuilder->processForm() (Line: 320)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 134)
Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase->renderExposedForm() (Line: 1238)
Drupal\views\ViewExecutable->build() (Line: 70)
views_fieldsets_views_ui_display_tab_alter() (Line: 562)
Drupal\Core\Extension\ModuleHandler->alter() (Line: 381)
Drupal\views_ui\ViewEditForm->getDisplayTab() (Line: 204)
Drupal\views_ui\ViewEditForm->form() (Line: 106)
Drupal\Core\Entity\EntityForm->buildForm() (Line: 41)
Drupal\views_ui\ViewFormBase->buildForm()
call_user_func_array() (Line: 531)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm() (Line: 230)
Drupal\views_ui\Controller\ViewsUIController->edit()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 709)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

  1. Add an exposed entity reference filter (e.g., Taxonomy term field)
  2. Leave "Autocomplete" as the "Selection type" in the filter settings
  3. Enable BEF on view
  4. Set BEF settings for filter to use checkbox/radios

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

6.0

Component

Code

Created by

🇦🇹Austria maxilein

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

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