Problem/Motivation

#1202484: Improve usage of 'pager.manager' service in PagerSelectExtender, allow code to know the pager element ID used is causing a negative side effect in contrib, see #3201324: Tests fail on Drupal 9.2.

If a pager is created with a gap in the sequence of the pager elements, pager_test_preprocess_pager() fails when trying to preprocess not exixting pagers.

The template processor in theme.inc, template_preprocess_pager(), has protection for this

  // Nothing to do if there is no pager.
  if (!isset($pager)) {
    return;
  }

Proposed resolution

Copy the protection code to pager_test_preprocess_pager().

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3202014

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Does it need tests? It is already a hook implementation in a test module.

mondrake’s picture

Status: Active » Needs review
Issue tags: +Contributed project blocker

Major because it blocks Pagerer tests on D9.2

daffie’s picture

Status: Needs review » Reviewed & tested by the community

The small change to a test module look good to me.
We are only adding a check to see if the pager service has been loaded.
For me it is RTBC.

mondrake’s picture

Issue summary: View changes

  • catch committed 9aa1b1b on 9.2.x
    Issue #3202014 by mondrake, daffie: pager_test_preprocess_pager() should...
catch’s picture

Status: Reviewed & tested by the community » Fixed

I was confused how the test module could break contrib tests, but of course it can if they rely on the test module. Seems like a reasonable change to make and no way to actually test this, so committed/pushed to 9.2.x, thanks!

mondrake’s picture

Thanks for quick turnaround. Pagerer tests now pass on D9.2.

Status: Fixed » Closed (fixed)

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