Invalid default_value of field_content_visibility configuration of page content type causes error while configuring the field

Created on 13 December 2024, about 2 months ago

Problem/Motivation

Configuring the field_content_visibility of the page content type in an Open Social distribution causes the core field_ui module to throw an error, as it expects default_value to be an empty array instead of null.

TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in count() (line 243 of core/modules/field_ui/src/Form/FieldConfigEditForm.php).
Drupal\field_ui\Form\FieldConfigEditForm->form(Array, Object) (Line: 107)
.
.
.

Steps to reproduce

  1. Install the Open Social distribution.
  2. Navigate to the "Manage fields" page for the "Page" content type.
  3. Observe the error triggered by the core field_ui module due to the invalid default_value.

Proposed resolution

Update the default_value key in the configuration file to use an empty array { } instead of null. The corrected configuration should look like:

default_value: { }

Remaining tasks

  • Submit a patch with the updated configuration file.
  • Test the patch to ensure it resolves the error without introducing new issues.
  • Review and approve the patch on the issue queue.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Active

Version

12.4

Component

Code (back-end)

Created by

🇹🇷Turkey makbay

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

Comments & Activities

Production build 0.71.5 2024