If caching is enabled on a view, the views cache system uses the current interface language as part of the cache key to ensure that a view rendered in one language cannot be served from the cache to a user viewing the site in another language. This makes sense.

However, views display content (e.g. entities), so the content language of the current page should also be included in the cache key. Not doing so can cause problems in situations where the content language and interface language are not the same (e.g. a view that displays nodes rendered in French on a page that is otherwise displayed in English; in this case, the French nodes can later be pulled from the cache and displayed on a page that is supposed to be entirely in English, which is a bug).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

David_Rothstein’s picture

Status: Active » Needs review
FileSize
543 bytes

Here is a patch.

nicrodgers’s picture

Status: Needs review » Needs work

Changing status to trigger testbot

nicrodgers’s picture

Status: Needs work » Needs review

changing status to trigger test bot

nicrodgers’s picture

I've been experiencing this issue too, and am happy to report that the patch applied cleanly for me and has fixed the issue.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

I'm using it as well.

nicrodgers’s picture

Confirmed the patch still applies cleanly and works on the latest 7.x-3.x-dev.

colan’s picture

We've recently switched our testing from the old qa.drupal.org to DrupalCI. Because of a bug in the new system, #2623840: Views (D7) patches not being tested, older patches must be re-uploaded. On re-uploading the patch, please set the status to "Needs Review" so that the test bot will add it to its queue.

If all tests pass, change the Status back to "Reviewed & tested by the community". We'll most likely commit the patch immediately without having to go through another round of peer review.

We apologize for the trouble, and appreciate your patience.

nicrodgers’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
543 bytes

Re-uploading David's patch from #1, as per comment #7 to trigger test bot.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC thanks @nicrodgers

DamienMcKenna’s picture

Status: Reviewed & tested by the community » Fixed
Parent issue: » #2903944: Plan for Views 7.x-3.19 release

Committed, thank you.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.