Problem/Motivation
As of 9.3.0 it seems that when utilizing the Load more pager plugin when clicking to the second page of results you're redirected to a 404.
This appears to be a side effect of some sort of deprecation to the jquery/jquery.once libraries.
Similar issues seem to exist in Views Show More and Infinite Scroll:
- https://www.drupal.org/project/views_show_more/issues/3254931
- https://www.drupal.org/project/views_infinite_scroll/issues/3252577
Steps to reproduce
Create a View with more than 2 pages of results and add a "Load more" pager to that View. Click the "load more" button twice.
Proposed resolution
Adjust the library and js to utilize the core/once library.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3258966-2.patch | 1.22 KB | gcalex5 |
Issue fork views_load_more-3258966
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
Comment #2
gcalex5 commentedThis patch seems to resolve the issue.
Comment #3
gcalex5 commentedComment #4
n_nelson350 commentedTeam,
The patch fixes the ajax 404 issue but the contents are not appended on the page although the result response is retrieved in the ajax call.
Anyone has faced the same issue, please provide your resolution for this.
Thanks in Advance.
Comment #5
adsyy commentedHi,
I tried the patch too and didnt face your problem @n_nelson350. After two click, the content is append on the page.
Comment #6
kkalaskar commented#2 Patch worked for me as well.
Comment #7
alina.basarabeanu commentedI can replicate the issue.
Clicking a second time on the 'Load more' button I get a page not found and redirected to /views/ajax?page=2
Applying the patch from #2 fixed the issue. I can view multiple pages by clicking the button multiple times.
Comment #8
anybodyPatches should always be against the dev branch. :) Didn't test this.
Comment #11
kirst25Re-applied the patch as it wasn't applying to the 2.x dev branch.
Comment #12
lbrassaw commentedI applied the patch and didn't work at first. Realized I was on 2.0.0-alpha1 instead of 2.x-dev. Once I switched to 2.x-dev, it worked brilliantly. Thanks!
Comment #13
bbombachiniThis issue has also been addressed on https://www.drupal.org/project/views_load_more/issues/3290508 so if we could prioritize that one as it's also making the module D10 ready, it would be better.
Comment #14
i-trokhanenkoCommitted to this issue #3290508: Automated Drupal 10 compatibility fixes and released a new version of the module. Thanks all!