- Issue created by @sagesolutions
- Status changed to RTBC
about 2 months ago 7:14am 17 May 2025 - 🇭🇺Hungary boobaa
The patch is also needed for drupal/select2:2.0.0 and it works – thank you!
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
Update Select2 to 2.0.0 and go to /admin/structure/types/manage/article/form-display
Update Select2MultiCheckoxes class with proper function return type
Active
1.0
Code
The patch is also needed for drupal/select2:2.0.0 and it works – thank you!