Problem/Motivation

#3122526: Pager links inside a modal do not open in the modal addressed the issue with pager links in modal generally, but it looks like the "Last" pager link was missed.

Steps to reproduce

Basically the same as #3122526: Pager links inside a modal do not open in the modal steps to reproduce, except specifically for the "Last" pager link

  1. Create a custom route with a pager
  2. Create a route with a link to open the route in step 1 in a modal
  3. Open the modal, click the Last pager link
  4. Expected to see that page in the modal, but page is reloaded with ajax params rendered.

Alternative is to try enabling the pager_test test module and going to the /pager-test/modal-pager in browser.

Proposed resolution

In PagerPreprocess::preprocessPager(), change this:
$items['last']['attributes'] = new Attribute();
to
$items['last']['attributes'] = new Attribute($link_attributes);

Remaining tasks

  • Make the suggested change
  • Extend test coverage to include the Last pager link

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3572047

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:

Comments

godotislate created an issue. See original summary.

godotislate’s picture

Issue summary: View changes
sourav_paul’s picture

Hi @godotislate
I would like to work on this but can you put down steps to reproduce the issue?

Thanks...

godotislate’s picture

Issue summary: View changes
sourav_paul’s picture

Thanks @godotislate for your co-operation, Successfully reproduced the issue By using pager-test module.
Here is SC: https://www.awesomescreenshot.com/video/49293510?key=d31efee965340df71d1...

Raising MR for the fixes.

Thanks..

sourav_paul’s picture

Status: Active » Needs review
godotislate’s picture

Status: Needs review » Needs work

A comment on the MR.

sourav_paul’s picture

Status: Needs work » Needs review
godotislate’s picture

Status: Needs review » Reviewed & tested by the community

Nice work, @sourav_paul.
Ran the test-only job and it fails as expected: https://git.drupalcode.org/issue/drupal-3572047/-/jobs/8455421
lgtm

sourav_paul’s picture

Thanks @godotislate for your guidance

longwave’s picture

Version: main » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Nice find, great collaboration on the fix.

Committed and pushed 8b21d99491e to main and 89bc9a8a99b to 11.x and aac1f617cdb to 11.3.x. Thanks!

Doesn't backport to 10.6.x, not sure it's worth it now.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • longwave committed aac1f617 on 11.3.x
    fix: #3572047 "Last" pager links inside a modal do not open in the modal...

  • longwave committed 89bc9a8a on 11.x
    fix: #3572047 "Last" pager links inside a modal do not open in the modal...

  • longwave committed 8b21d994 on main
    fix: #3572047 "Last" pager links inside a modal do not open in the modal...

Status: Fixed » Closed (fixed)

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