If you use simple cache to cache a pane with a pager, all pager links return the same page. This small patch adds an additional part to the simplecache $cid for panes that have $pane->configuration['use_pager'] = 1.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kpander’s picture

This patch seems to resolve the problem for me. Cached panels with pagers now work again. Thanks!

bryancasler’s picture

Fixed this problem for me, thanks a million!

Nick Lewis’s picture

Status: Active » Reviewed & tested by the community

The patch is straightforward enough that I'm just going to bump it.

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

Committed to d6 and d7.

Status: Fixed » Closed (fixed)

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

dunlop’s picture

Version: 6.x-3.8 » 6.x-3.9
Status: Closed (fixed) » Active

My experience with this indicates that this bug is not 100% fixed. I must still wait the 'Lifetime' of the Simple cache before the pager will move to another page. The url links of the pager are correct but the page displayed stays the same when clicked. I have tried all the cache granularities (Arguments, Context, None) and none of them work as expected. I am normally using a 'Page' type display in my underlying view, but I did check using a 'Content pane' and it also did not page with Simple cache enabled.

When I change Simple Cache to 'No caching' then the pager does page correctly.

DamienMcKenna’s picture

Another problem, it doesn't verify that $_GET['page'] exists before adding it to the $id, it should be:

    $id .= ':p' . (empty($_GET['page']) ? '0' : check_plain($_GET['page']));
DamienMcKenna’s picture

Version: 6.x-3.9 » 7.x-3.x-dev
FileSize
553 bytes

Here's a patch of the code from #7 for D7, and it fixes the formatting of the if() statement.

DamienMcKenna’s picture

Status: Active » Needs review
Letharion’s picture

Assigned: Unassigned » merlinofchaos
DamienMcKenna’s picture

This still doesn't work if the item being displayed has a pager that isn't overridden by the display.

merlinofchaos’s picture

Status: Needs review » Fixed

I committed a patch earlier that just brute-force checks $_PAGE -- it is less efficient but it guarantees pagers will not be ignored.

DamienMcKenna’s picture

Status: Fixed » Needs work

The current code again ignores situations where you're using a pager from the pane's content itself (Views, custom content types, etc) rather than controlling it in the pane; it also doesn't identify whether the pager is for the current pane so would needlessly reload certain data. I think we have three options:

  • Continue improving the logic here, starting with making it properly aware of the pane's individual pager.
  • Change Panels to be aware of there being a pager at all - this can be identified from Views and perhaps the CTools content type plugin API could be extended to indicate that a pager exists.
  • Mark this is a known issue and document the behavior.
andypost’s picture

Also this does not take into account a pager ID which could be different

DamienMcKenna’s picture

FYI Panels Hash Cache looks like it might be the best current option for Panels caching, though I've not tested it yet.

  • Commit ea892e1 on 7.x-3.x, master, pipelines, 7.x-3.x-i18n, 8.x-3.x by merlinofchaos:
    #961662 by Nick Lewis: Account for pager info in simple caching.
    
    

  • merlinofchaos committed ea892e1 on 8.x-4.x
    #961662 by Nick Lewis: Account for pager info in simple caching.