Type Error $elements must be of type array, null given

Created on 2 June 2025, about 2 months ago

Problem/Motivation

When adding a new boolean field, I get this error after entering the field name:
TypeError: Drupal\Core\Render\Element::children(): Argument #1 ($elements) must be of type array, null given, called in /var/www/html/web/modules/contrib/url_friendly_options/url_friendly_options.module on line 23 in Drupal\Core\Render\Element::children() (line 71 of core/lib/Drupal/Core/Render/Element.php).

Steps to reproduce

  1. Create a new boolean field, enter a label and a field name.
  2. Click next

It should show the field settings page, instead this error is displayed.

Proposed resolution

The error seems to be related to this change https://git.drupalcode.org/project/url_friendly_options/-/merge_requests... , which is checking for the allowed_values before these are set, simply adding an if statement before it fixed the problem in my local.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024