TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given in subfields_field_widget_validate() (line 538 of sites/all/modules/subfields/subfields.module).

Created on 24 February 2023, about 2 years ago

Getting error when using PHP 8.1:
TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given in subfields_field_widget_validate()
sites/all/modules/subfields/subfields.module line 538

To Resolve this error:
sites/all/modules/subfields/subfields.module line 538

Change this:
$is_empty_multiple = (!count($elements['#value']));

To:
$is_empty_multiple = (!count((array)$elements['#value']));

🐛 Bug report
Status

Needs review

Version

1.1

Component

Code

Created by

🇹🇳Tunisia matio89 UTC+1 🇹🇳

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

Comments & Activities

Production build 0.71.5 2024