I am sorry if this is a duplicate; I looked around first.
If I have an exposed filter enabled for a view and put it in a block, and then submit the form in the block, but the form does not pass validation, the original filter form shows up above the view (as it would be without putting the exposed filter in a block).
The usual case I see it is when I have a taxonomy term autocomplete exposed filter. The form tries to make sure that the term exists, and throws an error if it does not. So, if I leave a few letters in the autocomplete field, an error is raised.
Some of the problems this creates:
1) Kind of defeats the purpose of having the form in a block
2) Puts the same exact form on a single page, causing ID collisions
Still looking for ways to solve this. Thanks for all your great work.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | views-528838.patch | 756 bytes | zzolo |
| #1 | 20090723-k76n4qpskri5ed8tfmm3rmrnyx.jpg | 75.75 KB | zzolo |
Comments
Comment #1
zzolo commentedOh, also, a screenshot.
Comment #2
zzolo commentedI have actually run into this on both AJAX and non-AJAX.
Comment #3
zzolo commentedI have started to stare at the Views code which is pretty intense. I can't seem to find where exposed forms are added to a regular views display. Any help would be appreciated. I am figuring a simple look at if the view has an "exposed block" would be a good check.
Comment #4
zzolo commentedWith the help of pingers, we created this patch that checks to make sure that if there are errors that the main exposed form is not displayed.
Comment #5
merlinofchaos commentedDoes this break the exposed form if it's *not* in a block, though?
Comment #6
zzolo commentedAs far as I have tested, regular exposed forms show up after errors. I believe this is because you are caching the form after its rendered once (as a block), and this is simply making sure that it does not appear again.
Comment #7
neil.brown commentedsubscribing.
Comment #8
merlinofchaos commentedOk, yes, I see what you mean. Committed this to all branches. Thanks!