Problem/Motivation

When you have an ajax paginated view, the return button to the previous page has a href "/views/ajax", when it should be the absolute url of the page in question.

Steps to reproduce

Create a paginated view and enable Ajax. Go to page 1.

Proposed resolution

Adapt the getQueryWithoutPageZero method in SeoPagerService.php.
Currently, when there are no arguments, the method returns \Drupal::request()->getPathInfo(); which does not work in an Ajax-enabled context.

Issue fork seo_pager-3442639

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

fwust created an issue. See original summary.

fwust’s picture

StatusFileSize
new685 bytes
sourabhsisodia_’s picture

Assigned: Unassigned » sourabhsisodia_

sourabhsisodia_’s picture

Assigned: sourabhsisodia_ » Unassigned
Status: Active » Needs review
sourabhsisodia_’s picture

StatusFileSize
new518.01 KB

@fwust The patch looks good , created a MR for it ,Tested the MR . Attaching a Screenshot for reference.

  • sourabhsisodia_ committed ecbdf07e on 1.0.x
    Issue #3442639: Corrected previous page href to absolute url of page in...
esha_kundu’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new366.81 KB
new373.89 KB

Hello,
I have followed the below steps to review,

  • Installed the module, used the frontpage view where I enabled Ajax.
  • Went to page 2 and checked the prev button href which had /views/ajax.
  • Applied the MR!3, which applied cleanly.
  • Rechecked by going to page 3, checked the prev button href which had /node (correct href of frontpage).

Have included the before and after ss for reference.
Hence, moving to RTBC.
Thanks :)

_cosmos_’s picture

Oh thank you @esha_kundu for review!

sourabhsisodia_’s picture

Hi @_cosmos_,
Thanks for merging the MR.

I noticed that I wasn't credited for resolving this issue. I'm not sure why that happened. Is there something I'm missing?