Argument #1 ($elements) must be of type array, null given

Created on 10 November 2023, about 1 year ago
Updated 16 September 2024, 2 months ago

Problem/Motivation

In Drupal 10.1.6 we are getting this error in our logs:

TypeError: Drupal\Core\Render\Element::children(): Argument #1 ($elements) must be of type array, null given, called in web/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php on line 966 in Drupal\Core\Render\Element::children() (line 72 of web/core/lib/Drupal/Core/Render/Element.php).

Steps to reproduce

Install Drupal 10. Use a filter in views. We are also using the Better Exposed Filters module.

Proposed resolution

See attached proposed patch.

πŸ› Bug report
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 3 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States kenrbnsn New Jersey

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.

  • Issue created by @kenrbnsn
  • Status changed to Needs review about 1 year ago
  • A lot of sites are using Drupal 10, views filters, and BEF. We need to find out the real steps to reproduce.

  • last update about 1 year ago
    29,682 pass
  • πŸ‡ΊπŸ‡ΈUnited States kenrbnsn New Jersey

    Ok. We will try to come up with a way to reproduce the error. As of now, we're just seeing it in our Drupal logs.

  • Status changed to Needs work about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Moving to NW for the steps as mentioned in #2. May need to investigate too why that value could be null so we aren't masking a larger issue potentially.

  • Status changed to Postponed: needs info 12 months ago
  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    Moving to postponed since there is obviously more needed for this error to be shown than just adding any filter to a View

  • πŸ‡ͺπŸ‡ΈSpain akalam

    I can reproduce it after upgrading to 10.3.1
    The patch solved the issue

  • πŸ‡«πŸ‡·France dqd London | N.Y.C | Paris | Hamburg | Berlin

    TypeError: Drupal\Core\Render\Element::children(): Argument #1 ($elements) must be of type array, null given is like a Virus these days. It spreads all over the issue queues and we can reproduce it on every single Drupal 11 install here. No matter if barebone vaniall core or added up with contrib modules, the error occurs with back trace to core Views, Layout Builder or to different bigger contrib modules like Display Suite and others. My assumption is that PHP becomes now more strict on types and we got away with it before how it was ... until now.

Production build 0.71.5 2024