Jump to:
| Project: | Views |
| Version: | 7.x-3.5 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Because all exposed forms have the same ID, if you have two or more exposed forms on a page, they clash and you can get errors. In our case this is because on every page we have a search block which is created using Search API and Views. Thus on any page where there's also an exposed form for some other purpose, this issue arises. This problem was reported for the D6 version in #832026: Multiple copies of a view embedded on a page - trouble with exposed filters.
I have worked round the issue by faking the 'other' exposed form and assigning it a different form ID. It's also necessary in this case to have the form ID sent as a GET variable so the Forms API knows which form has been submitted.
So I would suggest adding two new options to the exposed block: one to set a different ID (a suffix to the current one) and the other to ensure the form ID is added as a GET variable.
(Ideally Views might detect when multiple exposed blocks for different views/displays appear on a page and turn on this behaviour.)
Comments
#1
I think making it configurable would be kind of featuritis, but in general it might should use drupal_html_id, though if this is runned you might end up with unstyled html content. You know, HTML-IDs are basically broken in general in a such complex setup like a drupal.
#2
It's not the HTML form ID that's the issue, it's the internal form id being shared, which leads to the problem that the form API cannot tell which of two forms on the page is submitted.
#3
OH!