Problem/Motivation

pager.inc uses global variables, has confusing/incomplete documentation, and is lacking in automated tests.

This issue aims to track the various efforts in play to make this code better. Some of these issues are pretty stale -- I've included them so we can see discussions that have already happened.

Proposed resolution

Convert Drupal's default pager to a service. This makes it easy to replace -- the zero-based vs. one-based debate could be solved right there!

Unfortunately proper cleanup would include removing the four globals in pager.inc. Since that's an API change, the best we can do in 8.x is deprecate them and include (deprecated) wrappers for the new service to maintain backwards comparability until 9.x.

Coming soon.

Tasks done

Remaining tasks

All of them...

User interface changes

None.

API changes

None -- include wrappers to maintain backwards compatibility.

Data model changes

None.

Comments

mikeker created an issue. See original summary.

larowlan’s picture

There is an issue to convert it to a service that was green at one stage

mikeker’s picture

Issue summary: View changes

#2: Found it. Thanks, @larowlan, I've added it to the issue summary along with the proposal to convert pagers into a service.

mikeker’s picture

Title: Pager.inc is a mess -- add tests and clean it up! » Pager.inc is a mess -- add tests, clean it up, make it a service!
mondrake’s picture

mondrake’s picture

Issue summary: View changes

Revived #2044435: Convert pager.inc to a service, and removed from issue summary the @todo code snippet that was removed in #2539472: Pager "first" and "previous" links have incorrect URLs.

mondrake’s picture

mondrake’s picture

Issue summary: View changes
mondrake’s picture

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mondrake’s picture

mondrake’s picture

mondrake’s picture

Issue summary: View changes
mondrake’s picture

Issue summary: View changes

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mondrake’s picture

dawehner’s picture

Title: Pager.inc is a mess -- add tests, clean it up, make it a service! » Pager.inc grew organically -- add tests, clean it up, make it a service!

A little bit nicer title :)

mondrake’s picture

Version: 8.2.x-dev » 8.3.x-dev
mondrake’s picture

Issue summary: View changes
mondrake’s picture

Title: Pager.inc grew organically -- add tests, clean it up, make it a service! » Pager.inc -- add tests, clean it up, convert to a service, use it!
mondrake’s picture

Issue summary: View changes
mondrake’s picture

Issue summary: View changes

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mondrake’s picture

Issue tags: +Kill includes
mile23’s picture

I've done a little refactoring on #2044435: Convert pager.inc to a service which seems to be the blocker here.

I'm switching the parent of #2044435: Convert pager.inc to a service from this issue to #2999721: [META] Deprecate the legacy include files before Drupal 9 because deprecating include files seems to have more momentum than just re-working the pager for its own sake.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

mondrake’s picture

Issue summary: View changes
kim.pepper’s picture

#2044435: Convert pager.inc to a service is in, so should we mark this Fixed?

mondrake’s picture

Issue summary: View changes
Status: Active » Fixed

I think so, since the remaining issues in the IS are probably better to live on their own.

Fixed, and a thought goes to @mikeker.

Status: Fixed » Closed (fixed)

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