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.

CommentFileSizeAuthor
#4 views_content_cache_output_key.patch1.14 KBhefox
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jstoller’s picture

This 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

Equinger’s picture

Have you made any headway on this? I'm having trouble on this front as well. I'm trying this with views 3 though.

jstoller’s picture

@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.

hefox’s picture

Curious, does this patch help at all?

kongoji’s picture

patch at #4 works well for me.

hefox’s picture

If 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.

Equinger’s picture

Thank you Hefox. Important fix.

jstoller’s picture

Status: Active » Reviewed & tested by the community

Awesome! 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

hefox’s picture

There's another views issue with a similar patch I believe

ChrisLaFrancis’s picture

Status: Reviewed & tested by the community » Needs work

I'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.

jstoller’s picture

My testing was done with Views 2.

jrstmartin’s picture

Thank you, hefox. #4 works for me. Views 6.x-2.16.

hanamizuki’s picture

same issue here, I'm using views 3.

Steven Jones’s picture

Status: Needs work » Closed (duplicate)