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.
Issue fork date_augmenter-3527500
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
Comment #2
phenaproximaComment #4
phenaproximaComment #5
nigelcunningham commentedI've encountered the same issue, reviewed the patch, applied it and found that it addresses the issue correctly. Moving to RTBC.
Thanks!
Comment #8
mandclu commentedThanks for identifying this, and for providing a fix. Merged in, and I will roll a new release shortly.