Compatibility issue PHP8.1

Created on 13 April 2023, over 1 year ago
Updated 8 October 2023, about 1 year ago

After updating a website using this project to [D9.5] and PHP8.1 (from D9.4 and PHP7.4) wet noticed fatal errors coming from pages without a translation.

TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /.../modules/contrib/dropdown_language/src/Plugin/Block/DropdownLanguage.php on line 227 #0 /...modules/contrib/dropdown_language/src/Plugin/Block/DropdownLanguage.php(227): count(NULL)

Not sure if it is stricter language validation in PHP8.1 or something changed in D9.5 where a variable is now NULL instead of an empty array...

Attached is a patch that fixed the problem for our website.

Summary

reminder: cause is a PHP Version, not Drupal core.

🐛 Bug report
Status

Fixed

Version

3.2

Component

Code

Created by

🇧🇪Belgium weseze

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

Comments & Activities

Production build 0.71.5 2024