Error with PHP 8.2 and field group

Created on 22 February 2024, about 1 year ago
Updated 23 February 2024, about 1 year ago

Problem/Motivation

I got 2 fatal errors with PHP 8.2

TypeError: Drupal\conditional_fields\ConditionalFieldsFormHelper::buildJquerySelectorForField(): Argument #1 ($field) must be of type array, null given, called in C:\Users\www\web\modules\contrib\conditional_fields\src\ConditionalFieldsFormHelper.php on line 202 in Drupal\conditional_fields\ConditionalFieldsFormHelper->buildJquerySelectorForField() (line 920 of C:\Users\www\web\modules\contrib\conditional_fields\src\ConditionalFieldsFormHelper.php).

TypeError: Drupal\conditional_fields\ConditionalFieldsFormHelper::elementAddProperty(): Argument #1 ($element) must be of type array, null given, called in C:\Users\www\web\modules\contrib\conditional_fields\src\ConditionalFieldsFormHelper.php on line 197 in Drupal\conditional_fields\ConditionalFieldsFormHelper->elementAddProperty() (line 843 of C:\Users\www\web\modules\contrib\conditional_fields\src\ConditionalFieldsFormHelper.php).

because PHP 8.2 want check type of variable strictement

Steps to reproduce

Proposed resolution

remove array or change to mixed

public function func buildJquerySelectorForField(array $field)
public function elementAddProperty(array $element, $property, $value, $position = 'prepend') 

to

public function buildJquerySelectorForField($field) 

public function elementAddProperty($element, $property, $value, $position = 'prepend') 
๐Ÿ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

๐Ÿ‡ซ๐Ÿ‡ทFrance lazzyvn paris

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024