Update Select2MultiCheckoxes class with proper function return type

Created on 22 January 2025, 5 months ago

Problem/Motivation

Trying to manage the form display on a content type of "article" at /admin/structure/types/manage/article/form-display throws this error

Fatal error: Declaration of Drupal\select2_multicheck\Plugin\Field\FieldWidget\Select2MultiCheckoxes::formElement(Drupal\Core\Field\FieldItemListInterface $items, $delta, array $element, array &$form, Drupal\Core\Form\FormStateInterface $form_state) must be compatible with Drupal\select2\Plugin\Field\FieldWidget\Select2Widget::formElement(Drupal\Core\Field\FieldItemListInterface $items, $delta, array $element, array &$form, Drupal\Core\Form\FormStateInterface $form_state): array in /app/web/modules/contrib/select2_multicheck/src/Plugin/Field/FieldWidget/Select2MultiCheckoxes.php on line 27 

Need to add array as the return type to match the Select2Widget

Steps to reproduce

Update Select2 to 2.0.0 and go to /admin/structure/types/manage/article/form-display

Proposed resolution

Update Select2MultiCheckoxes class with proper function return type

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇨🇦Canada sagesolutions

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