PHP8.1 compatibility - Configuration form

Created on 1 September 2022, over 2 years ago
Updated 18 February 2023, almost 2 years ago

Hello,
I am using PHP 8.1 and I got the issue when I try within views to configure the exposed form.
I got the error
TypeError : Unsupported operand types: string - int dans Drupal\views_ef_fieldset\Plugin\views\display_extender\ViewsEFFieldset->buildOptionsForm() (/var/www/vhosts/mywebsite/drupal/modules/contrib/views_ef_fieldset/src/Plugin/views/display_extender/ViewsEFFieldset.php ligne 201)
I fixed it by changing line 201 from

        'weight' => isset($field_options['weight']) ? $field_options['weight'] : (isset($field->weight) ? $field->weight : $index - count($exposed_fields)),

to

        'weight' => isset($field_options['weight']) ? $field_options['weight'] : (isset($field->weight) ? $field->weight : intval($index) - count($exposed_fields)),

🐛 Bug report
Status

Closed: duplicate

Version

1.5

Component

Code

Created by

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.

Production build 0.71.5 2024