PagerDefault doesn't respect already defined pagers.

Created on 3 December 2012, about 12 years ago
Updated 30 January 2023, almost 2 years ago

Problem/Motivation

The query extender PagerDefault doesn't check if there are already global defined pagers. The class starts an own counting of pagers by using static $maxElement = 0;.
If you've already defined pagers by pager_default_initialize() the query extender will overwrite them as soon as the query is executed.

Proposed resolution

Get rid of static $maxElement = 0; and use the global variable $pager_page_array in ensureElement() to ensure an unique pager id is used for the query extender.

Remaining tasks

Clarify if there are cases in which this handling could lead to unexpected errors.

User interface changes

None

API changes

No real API changes, but the signature of the class PagerDefault will change a bit as static $maxElement = 0; is removed.

🐛 Bug report
Status

Needs work

Version

10.1

Component
Database 

Last updated 2 days ago

  • Maintained by
  • 🇳🇱Netherlands @daffie
Created by

🇨🇭Switzerland das-peter

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Production build 0.71.5 2024