Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If I enable a Simple Cache on a pane, and clear the cache, I get the following errors:
- Notice: Undefined index: use_pager in panels_simple_cache_get_id() (line 107 of /var/www/html/d6/drupal-6.22/sites/all/modules/panels/plugins/cache/simple.inc).
- Notice: Undefined variable: tokens in panels_cache_object->cache() (line 214 of /var/www/html/d6/drupal-6.22/sites/all/modules/panels/includes/plugins.inc).
- Notice: Undefined index: use_pager in panels_simple_cache_get_id() (line 107 of /var/www/html/d6/drupal-6.22/sites/all/modules/panels/plugins/cache/simple.inc).
On the next refresh, I do not get the pane and only one error:
- Notice: Undefined index: use_pager in panels_simple_cache_get_id() (line 107 of /var/www/html/d6/drupal-6.22/sites/all/modules/panels/plugins/cache/simple.inc).
Comments
Comment #1
nicholasThompsonThe use_pager bug can be fixed using:
As for the token issue, I simply removed the following from includes/plugin.inc and (a) the error went away and (b) My pane reappeared.
I'm not entirely sure what this code is trying to achieve. Should it be merging rather than un-setting?
EDIT: To clarify - this is on line 208 of includes/plugin.inc (at the end of
function cache()
).Comment #2
nicholasThompsonHmm actually the issue appears to be more related to if you cache an entire panel AND a pane...
In my case I have a panel and I add the Page Title pane. I then enable a Simple Cache on both the pane and the panel. On the first load, the Page Title pane appears correctly, but on the following load I get the text "Array" instead. However, if I only enable the Simple Cache on the PANE (not the whole PANEL), then there is no error..
Comment #3
nicholasThompsonI have found that changing the above token snippet simply to:
That merges any page-specific tokens into the array to be cached... Although it is a bit of a "brute force" approach.
Comment #4
Letharion CreditAttribution: Letharion commentedHello nicholasThompson, can you please provide
1) A way to reproduce this, and
2) your fix in a patch format, to allow for a review.
Comment #5
Letharion CreditAttribution: Letharion commentedComment #6
brunodboThis is still happening in 7.x-3.9:
- Add the 'Page title' pane to a panel page (in my case, the node_view panel)
- Enable 'Simple cache' on the display
- On the first page load (not cached), the page title pane will appear normally (outputting the page title with tags if configured).
- On subsequent page loads (cached), the page title pane will output
Array
instead of the page title.The solution mentioned in #3 didn't work for me.
Comment #7
joelpittetComment #8
joelpittetWorked with @brunodbo this afternoon and turns out this is a ctools bug. Closing as a duplicate of #1365522: Caching issue: include files not included when processing page tokens?