($haystack) must be of type array, null given PHP8 bug

Created on 10 November 2022, about 2 years ago
Updated 4 March 2024, 9 months ago

When attemping to view /admin/config/content/better_field_descriptions the following error is returned

The website encountered an unexpected error. Please try again later.
TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in in_array() (line 95 of modules/composer/better_field_descriptions/src/Form/BetterFieldDescriptionsSettingsForm.php).

This appears to be a PHP 8 compatibility issue

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇺🇸United States srdtwc Skokie, IL

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.

  • 🇮🇳India omrmankar Mumbai, Maharashtra

    Please review the code.

  • 🇺🇸United States TolstoyDotCom L.A.

    I installed the module and visited that page. Both $bfde and $bfds (lines 77 and 79 of BetterFieldDescriptionsSettingsForm, respectively) were NULL. It looks like the patch will resolve the warning, but maybe just showing a message 'Select the entities you want first' should be shown if $bfde is NULL.

  • 🇺🇸United States stevenpatz Alexandria VA

    can this patch be applied and a new version pushed?

Production build 0.71.5 2024