Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 300763

Exposed filter form exposed as block: form_id simply views_exposed_form

$
0
0

When you create exposed filters in a view, and expose them as a block which you can place on different pages, and then want to manipulate the form using hook_form_alter(), the $form_id which is passed to hook_form_alter() is set to views_exposed_form - which is too general.

You can get the proper id via $form['#id'] (which includes the view name and display - e.g. "views-exposed-form-events-page-3"), but should $form_id not hold the correct id of the form?

Not a big deal, as you can easily compare to $form['#id'], but why then pass the variable?


Viewing all articles
Browse latest Browse all 300763

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>