- Issue created by @vasike
- Merge request !13Issue #3425836: Fix for hook_form_views_exposed_form_alter() called multiple... → (Open) created by vasike
- Status changed to Needs review
10 months ago 4:39pm 5 March 2024 - 🇷🇴Romania vasike Ramnicu Valcea
First: very nice module - good idea, so thanks
There is a new MR that tries to solve this.
However it doesn't eliminate multiple calls ... but it limit to 2 calls only
+ to have control in the alter hook with new form property$form['#selective_bef_view']
.I hope it helps.
- 🇷🇴Romania vasike Ramnicu Valcea
It seems them MR "solution" it doesn't work "properly" ... as for all the filters to work it's need to have this view built and executed every time.
However, from
Drupal\selective_better_exposed_filters\Plugin\better_exposed_filters\filter\SelectiveFilterBase
there is a view property that could be used inhook_form_views_exposed_form_alter()
implementationExample
/** * Implements hook_form_FORM_ID_alter() for views_exposed_form. */ function custom_module_form_views_exposed_form_alter(array &$form, FormStateInterface $form_state) { $view = $form_state->get('view'); if (empty($view->selective_filter)) { // ... "do the alter". } }
Question1: isn't easier as $form property
Ex.$form['#original_views_exposed_form'] = TRUE;
Question2: What about document this issue, README file and/or project page info.
Changed the issue Category to Support request
And status keep it Needs Review ... for nowp.s. sorry for the noise.