While working on #2596649: Exposed form does not save state when it is placed in a block I found out that views exposed filters provide broad cache contexts (they mark the URL as context). Their real context however is just specific query arguments on the URL, so they should provide url.query_args:*** as their cache context.

Attached patch fixes this, but will probably break tests.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

legolasbo created an issue. See original summary.

legolasbo’s picture

Issue tags: +Needs tests

Hmm, seems like the cache contexts for these filters don't have test coverage.

dawehner’s picture

I'm quite sure that this issue is a duplicate of some other issue, but I can't find the other issue at the moment. IMHO when this issue has a test, we could also just get this issue!

alexej_d’s picture

legolasbo’s picture

@alexej_d,

I think the issue you mentioned is actually related to #2596649: Exposed form does not save state when it is placed in a block since the exposed form block doesn't currently provide any cache contexts. This issue is about the fact that the cacheContext exposed filters in general is currently the entire URL, while it should be specific URL arguments.

Wim Leers’s picture

legolasbo’s picture

Status: Needs review » Closed (duplicate)