I is possible to:
- Hook on
views_pre_view
(which is executed beforeform_alter
) - Query
view data
(execute the view query filtering according to URL parameters) and collect some data - Hook on
form_alter
- Replace some selects using data collected on item 2?
I'm asking because if I $view->execute()
inside views_pre_view
(to filter and use view data) it will internally call form_alter
and generate the form before I'm able to collect the data to pre-populate my selects. And I'm not sure if it's possible to re-generate a form that was already generated.
I also tried views_pre_execute
but this one is always executed after form_alter
.
Cheers!