Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I got the module installed and running, but I had the following problem:
After the page is loaded, the pager is there (which is how it should be). When I click it, it loads the new records by AJAX , also as expected. But the problem then is that the newer pager doesn't show up, although it is sent by drupal.
I did some digging and found that there was a problem in the JS file, where it attempts to place the new pager in an element that doesn't exist.
Here's a little patch to fix this:
--- views_load_more.js (revision 359)
+++ views_load_more.js (working copy)
@@ -55,7 +55,7 @@
// Add the new content to the page.
wrapper.find('.pager a').remove();
- wrapper.find('.pager').parent('.item-list').html(new_content.find('.pager'));
+ wrapper.find('.pager').replaceWith(new_content.find('.pager'));
wrapper.find(content_query)[method](new_content.find(content_query).children());
if (effect.showEffect != 'show') {
wrapper.find(content_query).children(':not(:visible)')[effect.showEffect](effect.showSpeed);
PS. This patch is against the dev version.
Comment | File | Size | Author |
---|---|---|---|
#21 | views_load_more-issue-1644036.patch | 511 bytes | Rade |
#11 | views_load_more-issue-1644036.diff | 612 bytes | maijs |
Comments
Comment #1
khaled.zaidan CreditAttribution: khaled.zaidan commentedComment #2
khaled.zaidan CreditAttribution: khaled.zaidan commentedany news here?
This issue is still there in the new dev version
Comment #3
ericduran CreditAttribution: ericduran commentedThis makes sense.
Not sure why you're having issues with this in the 1st place, my guess is the item-list is different for some reason, that being said the code changes seems better anyway.
Comment #4
jide CreditAttribution: jide commentedSeems this has been committed.
Comment #5
jide CreditAttribution: jide commentedWoops ! No in fact, sorry.
Comment #6
TravisWeihermuller CreditAttribution: TravisWeihermuller commentedI had this same issue even after the fix, it was caused by displaying full content with comments. once I took the comments off it loaded just fine. I believe the comments pager was interfering with the views pager. Hope that helps.
Comment #7
agalitsyn CreditAttribution: agalitsyn commentedPlease commit it to dev version. Annoying problem
Comment #8
rooby CreditAttribution: rooby commentedThis is a duplicate of #2000572: Pager Link not appended and #1806422-30: Works only once, but with a slightly different approach (and no actual patch file).
Up to the maintainer as to chich approach is preferred.
Comment #9
opdorp CreditAttribution: opdorp commentedSame problem! this fixed it for me!
Comment #10
maijs CreditAttribution: maijs commented@khaled.zaidan, thanks, it seems your solution makes this module work as expected.
Comment #11
maijs CreditAttribution: maijs commentedI'm attaching the patch created by @khaled.zaidan so it can be tested by downloading the file.
Comment #12
cameron prince CreditAttribution: cameron prince commentedI can confirm that the patch from #11 resolves the problem.
Comment #13
5n00py CreditAttribution: 5n00py commentedConfirm! Waiting in 7.x-1.x
Comment #14
JordanMagnuson CreditAttribution: JordanMagnuson commentedConfirmed: #11 works.
Comment #15
sw3b CreditAttribution: sw3b commented#11 work for me also !
Comment #16
sashken2 CreditAttribution: sashken2 commentedConfirmed: #11 works good for me.
Comment #17
himerus CreditAttribution: himerus commentedConfirmed: #11 works.
Comment #18
aether CreditAttribution: aether commentedYes. #11 works.
Comment #19
bshaddad CreditAttribution: bshaddad commentedConfirmed: #11 solved the issue.
Comment #20
rp7 CreditAttribution: rp7 commentedConfirmed, #11 works
Comment #21
Rade CreditAttribution: Rade commented#11 works, but the patch does not work on the current dev anymore as the line number have changed. Adding updated version that works on 7.x-1.2 and the current dev. Props still go to khaled.zaidan :)
Comment #22
Cyberschorsch#21 is working beautiful
Comment #23
mglaman#11/#21 worked! Thanks
Comment #24
basvredeling#21 is RTBC (status has been since #5??)
Comment #25
zmove CreditAttribution: zmove commentedPatch correct the button disappearing after the first ajax refresh.
However (don't know if it's related but I think yes) if you use Waypoint with infinite scroll option, it will works the first time only.
Comment #26
zmove CreditAttribution: zmove commentedI put this issue to need work for infinite scroll problem.
Comment #27
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedremove is not a function in jquery wayports 2.0+
https://drupal.org/node/1889300
Comment #28
indydas CreditAttribution: indydas commentedYeah with 7.x-1.2 set up on mine the button disappears even with infinite scroll disabled as pointed out in #25.
Comment #29
tregismoreira CreditAttribution: tregismoreira commented#21 works for me. Thanks!
Comment #30
Rajab Natshah CreditAttribution: Rajab Natshah commented#11 works .. Thanks :)
Comment #31
Nicolas Bouteille CreditAttribution: Nicolas Bouteille commentedComment #32
Nicolas Bouteille CreditAttribution: Nicolas Bouteille commented#21 solved the problem for me too thanks!
I think this is a blocking thus major problem and I can't believe it's been reported since june 2012 and still not committed... two years for a blocking bug single-line-fixed? We can do better than that can't we?
Comment #33
rollingnet CreditAttribution: rollingnet commentedI subscribe for patch #21 to be committed
it works
Comment #34
jiv_e CreditAttribution: jiv_e commentedConfirming that patch #21 works. I used Display Suite to create Views rows.
Comment #35
jiv_e CreditAttribution: jiv_e commentedComment #36
heshanlk#21 works fine.
Comment #37
s_leu CreditAttribution: s_leu commentedCan also confirm patch in #21 is working fine. Please commit.
Comment #38
ocastle CreditAttribution: ocastle commented#21 Fixed it for me too. Thanks.
Comment #39
gausarts CreditAttribution: gausarts commented#21 RTBC as well. it also works with Omega 4 which removes the item-list wrapper, good catch not to depend on the wrapper. Thanks.
Comment #40
m4oliveiHello all. Thanks for the work on this issue. I just picked up co-maintainership and have been reviewing the issue queue.
As far as I can tell, this issue should be fixed by #1919896: Does not work correctly with nested views. I've committed that to 7.x-1.x-dev since it seems to have fixed this issue while at the same time considering that case where views are nested (attachments). Please checkout the latest on 7.x-1.x branch and let me know if it fixes your issue :).
Feel free to re-open if it's still affecting you.
Thanks,
Matt
Comment #41
FreekVR CreditAttribution: FreekVR commentedThe latest dev-branch, or applying the patch in #1919896: Does not work correctly with nested views, causes more issues than it solves (please see my comment in aforementioned issue).
The patch in #21 works flawlessly on the lastest stable, however.
Comment #43
m4oliveiI've incorporated the patch here into the latest 7.x-1.x branch. Please checkout the latest 7.x-1.x branch to see if it's working for you.
Comment #44
m4olivei