Problem/Motivation

If you use the Views cache with "Content pane" displays, it'll use the same cache entry for all instances of that pane, even if they have different settings.

Steps to reproduce

  1. Install the latest Drupal 7 and enabled the following modules: views, views_content, views_ui, panels, page_manager
  2. Create a new view, with a 'Content pane' display that is using the fields row plugin, and change the 'Allow settings' to include 'Fields override'
  3. Add some additional fields to the view, so we have some we can disable in the pane settings
  4. Under 'Advanced', change 'Caching' to 'Time-based' with the default settings, and save the view
  5. Create a new Panels-based page_manager page, and place two instances of view you created above. On the settings for one of the panes, leave all the fields checked under "Fields to display", on the other, disable a couple fields
  6. Update and save the page_manager page
  7. Visit the page_manager page: the expected result is that the two instances of the view are showing different fields, however, you'll see that they both show the same fields (using the configuration of which ever instance came first)

Proposed resolution

The problem is that views is using the same 'cid' for the cache entry for both instances of the view. We need to get the view's display options included in the 'cid'. I have a patch that does this which I'll post in a moment.

Remaining tasks

  1. Make patch
  2. Test and review
  3. Commit

User interface changes

None.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#2 views-cache-panes-3205465-2.patch530 bytesdsnopek

Comments

dsnopek created an issue. See original summary.

dsnopek’s picture

Title: Views cache incomptible with 'Content pane' displays from 'views_content' module (sub-module of CToools) » Views cache incomptible with 'Content pane' displays from 'views_content' module (sub-module of CTools)
StatusFileSize
new530 bytes

Here's the patch!

damienmckenna’s picture

Status: Active » Needs review
cboyden’s picture

We've tested this on our distribution and it's working as intended.

renatog’s picture

@cboyden as it works for you can we update the Issue Status = RTBC?

damienmckenna’s picture

Status: Needs review » Reviewed & tested by the community
Parent issue: » #3118500: Plan for Views 7.x-3.25

Tadaa.

Thanks everyone.

damienmckenna’s picture

Title: Views cache incomptible with 'Content pane' displays from 'views_content' module (sub-module of CTools) » Views cache incompatible with 'Content pane' displays from 'views_content' module (sub-module of CTools)
Status: Reviewed & tested by the community » Fixed

Committed. Thank you!

Status: Fixed » Closed (fixed)

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