Fatal error: Declaration of Drupal\viewsreference_filter\Plugin\ViewsReferenceSetting\ViewsReferenceExposedFilters::alterFormField must be compatible with Drupal\viewsreference\Plugin\ViewsReferenceSettingInterface::alterFormField

Created on 1 December 2020, over 4 years ago
Updated 13 January 2025, 3 months ago

Problem/Motivation

When a paragraph is using a Views Reference Field and in the editor, the user tries to select a paragraph type and ajax error is triggered.

Fatal error: Declaration of Drupal\viewsreference_filter\Plugin\ViewsReferenceSetting\ViewsReferenceExposedFilters::alterFormField(&$form_field) must be compatible with Drupal\viewsreference\Plugin\ViewsReferenceSettingInterface::alterFormField(&$form_field, ?Drupal\views\ViewExecutable $view = NULL) in /var/www/html/docroot/modules/contrib/viewsreference_filter/src/Plugin/ViewsReferenceSetting/ViewsReferenceExposedFilters.php on line 23

I assume that this will occur with fields using views reference field with or without paragraphs.

Proposed resolution

I'll attach a patch which declares alterFormField method in ViewsReferenceExposedFilters as expected by ViewsReferenceSettingInterface

🐛 Bug report
Status

Closed: cannot reproduce

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom welly

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024