The module smart_paging is not functioning anymore after upgrading the Drupal core to 7.71
7.70 was okay, both on develop and on production sites. Going back to 7.70 solves the problem, but that is not the intention, is it.

In detail: splitting pages by using the line <!--pagebreak--> in long html-docs does not show the possibility to go to the next page (or to the EOF). Instead there is empty space on the end of the screen, no longer the opportunity to scroll. The user has to stay on page 1!

Only local images are allowed.

CommentFileSizeAuthor
#9 3149681-9.patch814 bytesmcdruid

Comments

Thale created an issue. See original summary.

Thale’s picture

Issue summary: View changes
Thale’s picture

Issue summary: View changes
Thale’s picture

Issue summary: View changes
fortran77’s picture

Hi Thale, I listed the file changed from 7.70 and 7.71 and one such file is includes/pager.inc
Restoring the 7.70 version of pager.inc seems to have fixed the issue for me. This is of course not a permanent solution but allows us to narrow down the issue.

mcdruid’s picture

Project: Drupal core » Smart Paging
Version: 7.x-dev » 7.x-2.x-dev
Component: other » Code

This looks like a regression in the smart_paging module caused by the changes made for PHP 7.4 compatibility in #3084961: Trying to access array offset on value of type null in theme_pager/pager_first/pager_last/pager_previous/pager_next().

https://git.drupalcode.org/project/drupal/-/commit/ae921e89b1059ea25caba...

Having a quick look at smart_paging, my initial impression is that it's calling theme_pager() without first calling pager_default_initialize().

This has worked until the recent changes, but would have been causing PHP errors / notices in core as some of the global variables theme_pager() uses would not have been initialised.

I'm going to move this to the smart_paging module's issue queue, as I think this needs to be fixed there.

fortran77’s picture

Hi mcdruid thank you for the help.
I tried callling pager_default_initialize() before the call to theme('pager') on line #1129 of the module but that did not seem to help (I might be missing some important detail though).

mcdruid’s picture

Status: Active » Needs review
StatusFileSize
new814 bytes

I can't say for sure that this is the right fix (600-line functions are not the easiest to grok), but this patch seems to avoid the problem in a very simple test scenario.

Hopefully it's a start.

  • arpeggio committed 31770aa on 7.x-2.x authored by mcdruid
    Issue #3149681 by mcdruid: Fixed paginator not working after updating to...
arpeggio’s picture

Status: Needs review » Fixed

@mcdruid I have already pushed your patch. Thank you for sharing it.

Status: Fixed » Closed (fixed)

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