Fatal error after updating to Drupal 11.2.0: incompatibility in submitConfigurationForm() declaration in GoogleSearchBlock

Created on 19 June 2025, 23 days ago

Problem/motivation

After updating my site to Drupal 11.2.0, when using the contrib google_cse module, I get the following fatal error:

Fatal error: Declaration of Drupal\google_cse\Plugin\Block\GoogleSearchBlock::submitConfigurationForm(array &$form, Drupal\Core\Form\FormStateInterface $form_state) must be compatible with Drupal\Core\Block\BlockBase::submitConfigurationForm(array &$form, Drupal\Core\Form\FormStateInterface $form_state): void in /var/www/html/web/modules/contrib/google_cse/src/Plugin/Block/GoogleSearchBlock.php on line 158

Steps to reproduce

  1. Update Drupal to version 11.2.0.
  2. Enable or use the google_cse module.

Proposed resolution

Update the submitConfigurationForm() method declaration in GoogleSearchBlock to include the return type : void, as now required by the parent class in Drupal 11

πŸ› Bug report
Status

Active

Version

5.0

Component

Code

Created by

πŸ‡ͺπŸ‡¨Ecuador leoenriquezp

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