There are many situations where developers want to alter View exposed forms based on the results (i.e. after the View is executed).
For instance:
- Set the default value of an exposed filter depending on the min/max value found in the result set
- Removing options from a select list if no results found (i.e. remove tags from an exposed taxonomy term filter)
+1 to make this issue move forward.
Assigning it to me, will try to propose a patch asap.
- Status changed to Closed: works as designed
26 days ago 9:05am 27 January 2025 - π³π±Netherlands johnv
I guess there is a misunderstanding here.
From 'web\core\modules\views\src\Plugin\views\exposed_form\ExposedFormPluginInterface.php'
Exposed forms are used for filters, sorts, and pager settings that are
* exposed to site visitors. Exposed form plugins handle the rendering,
* validation, and submission of exposed forms, and may add additional form
* elements.So, for example rendering the list box on an exposed filter.
But it does NOT change the output of the query. For that you need the filter/sort/... handler, that IS called in postExecute().
Regarding #18, you need to implement hook_views_post_execute() or hook_field_views_pre_render() in your Views filter plugin.
However, doing that, you will encounter query result problems, as summarized in π± [META] Fix pager bug reports Active .