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 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.
Comment | File | Size | Author |
---|---|---|---|
#8 | panels-n961662-8.patch | 553 bytes | DamienMcKenna |
panels-simple-cache-pager.patch | 362 bytes | Nick Lewis | |
Comments
Comment #1
kpander CreditAttribution: kpander commentedThis patch seems to resolve the problem for me. Cached panels with pagers now work again. Thanks!
Comment #2
bryancasler CreditAttribution: bryancasler commentedFixed this problem for me, thanks a million!
Comment #3
Nick Lewis CreditAttribution: Nick Lewis commentedThe patch is straightforward enough that I'm just going to bump it.
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted to d6 and d7.
Comment #6
dunlop CreditAttribution: dunlop commentedMy 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.
Comment #7
DamienMcKennaAnother problem, it doesn't verify that $_GET['page'] exists before adding it to the $id, it should be:
Comment #8
DamienMcKennaHere's a patch of the code from #7 for D7, and it fixes the formatting of the if() statement.
Comment #9
DamienMcKennaComment #10
Letharion CreditAttribution: Letharion commentedComment #11
DamienMcKennaThis still doesn't work if the item being displayed has a pager that isn't overridden by the display.
Comment #12
merlinofchaos CreditAttribution: merlinofchaos commentedI committed a patch earlier that just brute-force checks $_PAGE -- it is less efficient but it guarantees pagers will not be ignored.
Comment #13
DamienMcKennaThe 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:
Comment #14
andypostAlso this does not take into account a pager ID which could be different
Comment #15
DamienMcKennaFYI Panels Hash Cache looks like it might be the best current option for Panels caching, though I've not tested it yet.