Out of band data (css, js, head) is not cached with pane-specific caching.

Display renderer takes a snapshot of existing data (with panels_cache_object constructor) after rendering pane content:


$content = ctools_content_render($pane->type, $pane->subtype, $pane->configuration, array(), $this->display->args, $this->display->context);
 	
foreach (module_implements('panels_pane_content_alter') as $module) {
  $function = $module . '_panels_pane_content_alter';
  $function($content, $pane, $this->display->args, $this->display->context);
}
if ($caching) {
  $cache = new panels_cache_object();
  $cache->set_content($content);
  panels_set_cached_content($cache, $this->display, $this->display->args, $this->display->context, $pane);
  $content = $cache->content;
}

Moving $cache = new panels_cache_object(); above $content = ctools_content_render(..); seems to fix this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

olli’s picture

Is anyone else having this problem?

1. Create a panel page
2. Create a view with pager and enable ajax
3. Add this view to the panel page
4. Set this pane's cache lifetime to 10 minutes
5. On first load the pager is working fine
6. Reload the page and ajax functionality is broken
7. After ten minutes pager is working again
8. Reload and pager broken

olli’s picture

Status: Active » Needs review
FileSize
2.75 KB
Letharion’s picture

Status: Needs review » Postponed (maintainer needs more info)

olli, sorry your issue got sitting so long. I belive this has been fixed in Panels now, could you please try again with a recent -dev version?

olli’s picture

Version: 6.x-3.9 » 6.x-3.x-dev
Status: Postponed (maintainer needs more info) » Active

I tried the latest -dev and could not reproduce the issue with a fresh drupal installation.

The issue still exists when using a site with Panels operating in legacy mode.

Letharion’s picture

I'm not sure "Not working in legacy mode", is a problem worth fixing. Do you have an argument for that?

merlinofchaos’s picture

Letharion: Yes that's worth fixing, though I don't actually have any idea how legacy mode could affect the caching. It shouldn't.

olli’s picture

Latest dev fixes only standard renderer and legacy mode enforces legacy renderer. Should we re-use the code with copy-paste or have legacy extend standard?

olli’s picture

Status: Active » Needs review
FileSize
1.15 KB
DamienMcKenna’s picture

vijaycs85’s picture

FileSize
1.18 KB
752 bytes

As per http://cgit.drupalcode.org/panels/commit/?id=f6f4cc5fc867dd8ae2ba7a70846... updating the condition to check for $cache is set.

DamienMcKenna’s picture

If anyone would be able to spare some time to review this patch it may get committed for the next release.

japerry’s picture

Status: Needs review » Closed (won't fix)

Nope, sorry, it won't :(