In update drupal to 10.5.8 and after Drush updb i get this error

PHP Fatal error: Declaration of Drupal\calendar_systems_bef\Plugin\views\exposed_form\CalendarSystemsBef::buildOptionsForm(&$form, Drupal\Core\Form\FormStateInterface $form_state) must be compatible with Drupal\better_exposed_filters\Plugin\views\exposed_form\BetterExposedFilters::buildOptionsForm(&$form, Drupal\Core\Form\FormStateInterface $form_state): void in /var/www/site.com/web/modules/contrib/calendar_systems/calendar_systems_bef/src/Plugin/views/exposed_form/CalendarSystemsBef.php on line 13

I use php 8.2.29 and Better Exposed Filters 7.1.1
Using chatGPT, I realized that this error is because the signature of the method in the child class is not the same as the parent class. and chatGPT suggested that I use void for classes in the CalendarSystemsBef.php file. After doing this, the problem was solved.

CommentFileSizeAuthor
solve-fatal-error-with-bef.patch1.2 KBamir jamshidi
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

  • 3563377- Comparechanges, plain diff MR !5
  • 1 hidden branch
  • 3563377 Comparecompare

Comments

amir jamshidi created an issue. See original summary.

amir jamshidi’s picture

Issue summary: View changes
hkoosha’s picture

Status: Active » Patch (to be ported)

Makes sense, likely BEF added type annotations in their new version.

Thanks for the patch!

hkoosha’s picture

Where did the "give credit" button go again I wonder, should we first merge the patch & only then give credits to you, Amir?

Ok found it
I'll try to merge it today

hkoosha changed the visibility of the branch 3563377 to hidden.

hkoosha’s picture

Status: Patch (to be ported) » Fixed

Merged into 8.x-3.x, please kindly test the result.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

amir jamshidi’s picture

Thanks
These changes have been applied to the 8.x-3.x version, and the module’s default branch is based on this version.
> Please port these changes to the 4.x version as well, and publish a release compatible with Drupal 11.

amir jamshidi’s picture

Status: Fixed » Needs review

doxigo’s picture

Status: Needs review » Fixed

Fixed, and a new tagged version published, thanks everyone

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.