views_exposed_form_cache() has some flaws
* it does not respect $form_state['no_cache'] - OK, this can be easily fixed
* it does not have a reset parameter - no problem per se but this makes userland workarounds for problem below impossible
* it caches by view&display-name which was a good idea when we only had views pages and blocks, but now with panels glory is not appropriate anymore - see example below
example which hit me:
1) create a views panel pane display
2) query it programatically and display the result count
3) show it as panels pane
result:
* in 2) $view->override_path is empty and gets stored in cached exposed form
* in 3) $view->override_path is panel path, but exposed form is taken from request cache
* so every exposed form submission redirects to frontpage
This problem generalizes when a view pane is used more than once in a request.
Comment | File | Size | Author |
---|---|---|---|
#3 | 0001-Issue-2009464-by-axel.rutz-Fixed-views_exposed_form_.patch | 970 bytes | geek-merlin |
#2 | 0001-Issue-2009464-Fixed-views_exposed_form_cache-should-.patch | 843 bytes | geek-merlin |
Comments
Comment #1
geek-merlinhuh, i've been in last century, but problem persists.
Comment #2
geek-merlinhere's a trivial D7 patch that i rolled for my project and needs forward-porting.
Comment #3
geek-merlinSame problem, same cure in 8.x views.
Comment #4
geek-merlinI found some other bugs in this, updating summary.
Comment #5
geek-merlinComment #5.0
geek-merlinUpdated issue summary.
Comment #6
geek-merlingooglefood
Comment #7
geek-merlinThis issue for request cache seems to correspond with #1055616: Query arguments should be replaced before generating cache ID for db cache.
The issue over there does refine the cache key. In fact we should use that cache key here also for request level caching.
Comment #8
bcobin CreditAttribution: bcobin commentedI tried manually applying the change from #2 on Views 7.3.x-dev with and without the patch from #7 - reset on exposed form still sends user to the front page in all cases.
ATAICT, this makes reset on exposed forms in panels unusable. Yikes!
Is there any workaround I can use? Any at all? Any guidance greatly appreciated... thanks! (Yikes again!)
Comment #8.0
bcobin CreditAttribution: bcobin commentedimproved summary
Comment #17
LendudeCleaning up old issues.
views_exposed_form_cache doesn't exist anymore, so this became hard to reproduce. If you feel this is still an issue in D7 or that the problematic code just got moved, feel free to open this back up (and possibly move to the D7 queue).