I have a page node, with an embedded view (viewfield) that has several exposed filters in a block. The first time the view is loaded, and cached, the pager is cached with whatever filter settings happen to be set at the time. From then on, if I change one of the filters and then use the pager, the filters change back to their cached value.
For example, lets say I have a "Color" filter, which can be Red, Blue, or Green. And lets say the filter is on Red the first time the view is loaded. Then, I change the filter to Green and the view changes. Then I click the pager to advance to the second page. The view will go to the next page, but the filter changes back to Red. If I change the filter to Green, clear the cache, then change the filter to Red and advance the pager, the filter will now revert to Green.
Comment | File | Size | Author |
---|---|---|---|
#4 | views_content_cache_output_key.patch | 1.14 KB | hefox |
Comments
Comment #1
jstollerThis seems to be a more general Views issue, since it happens with the time-based cache, as well as content cache. I've posted it in Views issue queue as well.
#1150394: Views caching breaks pager with exposed filters
Comment #2
Equinger CreditAttribution: Equinger commentedHave you made any headway on this? I'm having trouble on this front as well. I'm trying this with views 3 though.
Comment #3
jstoller@Equinger: I'm afraid not. The code is a bit beyond me. I've been hoping someone on the Views issue queue would take up the case and find a fix, but that hasn't happened yet. You might want to go to that issue and corroborate the problem. The more people experiencing it, the more likely someone will fix it, I expect.
Comment #4
hefox CreditAttribution: hefox commentedCurious, does this patch help at all?
Comment #5
kongoji CreditAttribution: kongoji commentedpatch at #4 works well for me.
Comment #6
hefox CreditAttribution: hefox commentedIf the result of a view is cached, they share the same rendered output currently, even if the exposed filters, etc. are different. This is a views bug that has a seperate issue post.. somewhere. That's the issue this patch fixes, but not sure if it's the same as the issue the OP is experiencing.
Comment #7
Equinger CreditAttribution: Equinger commentedThank you Hefox. Important fix.
Comment #8
jstollerAwesome! This appears to fix the problem.
@hefox: Should a more general fix be applied to Views? Can your patch be adapted to solve the problem there? The corresponding Views issue is at #1150394: Views caching breaks pager with exposed filters
Comment #9
hefox CreditAttribution: hefox commentedThere's another views issue with a similar patch I believe
Comment #10
ChrisLaFrancis CreditAttribution: ChrisLaFrancis commentedI'm still seeing this problem even after applying the patch in #4. If I change to the time-based caching, I don't experience the issue. Not sure if it matters, but I'm also using Boost (6.x-1.x-dev)... adding the view's page's path to the list of exclusions in Boost doesn't seem to make a difference. I'm using Views 6.x-3.0.
Comment #11
jstollerMy testing was done with Views 2.
Comment #12
jrstmartin CreditAttribution: jrstmartin commentedThank you, hefox. #4 works for me. Views 6.x-2.16.
Comment #13
hanamizuki CreditAttribution: hanamizuki commentedsame issue here, I'm using views 3.
Comment #14
Steven Jones CreditAttribution: Steven Jones commentedThis is a duplicate of #1055616: Query arguments should be replaced before generating cache ID