Problem/Motivation

In Drupal CMS, if you try to disable Layout Builder for a content type -- any content type -- in the UI, you'll get an exception:

TypeError: Unsupported operand types: array + null in Drupal\field_ui\Form\EntityViewDisplayEditForm->Drupal\field_ui\Form\{closure}() (line 170 of core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php). 

I traced this to date_augmenter_field_formatter_third_party_settings_form(), which can apparently return NULL in some situations. I am unfamiliar with the internals of this module so I'm not sure under what circumstances the NULL return can happen, but it's clearly possible.

Steps to reproduce

Install Drupal CMS, and then visit /admin/structure/types/manage/page/display and disable Layout Builder for that content type.

Proposed resolution

This function always has to return an array, so let's make sure it always does, and enforce that with a return type hint.

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

phenaproxima created an issue. See original summary.

phenaproxima’s picture

Issue summary: View changes

phenaproxima’s picture

Status: Active » Needs review
nigelcunningham’s picture

Status: Needs review » Reviewed & tested by the community

I've encountered the same issue, reviewed the patch, applied it and found that it addresses the issue correctly. Moving to RTBC.

Thanks!

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

mandclu’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for identifying this, and for providing a fix. Merged in, and I will roll a new release shortly.

Status: Fixed » Closed (fixed)

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