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.
| Comment | File | Size | Author |
|---|---|---|---|
| solve-fatal-error-with-bef.patch | 1.2 KB | amir jamshidi |
Issue fork calendar_systems-3563377
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:
Comments
Comment #2
amir jamshidi commentedComment #3
hkoosha commentedMakes sense, likely BEF added type annotations in their new version.
Thanks for the patch!
Comment #4
hkoosha commentedWhere 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
Comment #7
hkoosha commentedMerged into 8.x-3.x, please kindly test the result.
Comment #9
amir jamshidi commentedThanks
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.
Comment #10
amir jamshidi commentedComment #12
doxigo commentedFixed, and a new tagged version published, thanks everyone