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.
Hi,
in my case, the button (automatic load or not) runs the load-more animation, but then nothing comes. No new markup is loaded anywhere in the page. I've tried it with all external exposed filters & masonry removed - no change. No JS errors, no errors in drupal log? What am i missing? Debugging tips?
Comments
Comment #2
dotist CreditAttribution: dotist commentedactually, a js console warning is displayed:
Synchronous XMLHttpRequest on the main thread is deprecated
Comment #3
alioso CreditAttribution: alioso at Zivtech commentedSynchronous XMLHttpRequest on the main thread is deprecated
is unrelatedNot sure what theme you are using, but this probably comes from the fact that you don't have the proper meta tag on your views-content container, which is what the JS is looking for to append the rows loaded through Ajax. You'd need to have:
<div class="view-content" data-drupal-views-infinite-scroll-content-wrapper>
for the plugin to trigger.
probably being your missing piece. You can achieve this by templating (or editing) views.html.twig
Comment #4
dotist CreditAttribution: dotist commentedgreat - i'll try that out!
Comment #5
Daniel KorteI also have to manually add that container to my theme, but shouldn't the
views_infinite_scroll_preprocess_views_view()
function output this container for you? It seems this functionality is broken. I looked into it, but couldn't figure out why the container wasn't being rendered. I'm using a HTML List as my style plugin (if that helps).Comment #6
gilmord@Daniel Korte
It does not mean preprocess is broken.
It means your theme does not set "rows.attributes" in view template or unset those variable somewhere.
Comment #7
Daniel Korte@gilmord I'm not sure what I'm missing here. I tried the below HTML in my views-view.html.twig file, but it doesn't work:
<div{{ rows.attributes }}>{{ rows }}</div>
I'm not saying that the preprocess function itself is broken. I'm saying the implementation of those attributes doesn't seem to be working.
Comment #8
RAWDESK CreditAttribution: RAWDESK commentedI've had a similar symptom after installing the 8.x-1.5 version, but it had nothing to do with some missing wrapper as mentioned in #3,
but with a by ajax returned exception on devel/kint.
My suggestion is to check in your browser console the ajax response after hitting "load more".
If it doesn't contain the expected views html structure to append, it responds empty without any error message popping up.
PS. Below a snapshot of my relevant div structure, created on page load by hook_preprocess_views_view() inside the module :
so no need to create the data div yourself
Comment #9
Honza Pobořil CreditAttribution: Honza Pobořil as a volunteer commentedIs this bug also in 1.5 or it was introduced later?
If you will not reply in a ~week I will release 1.6 from the current dev.
Comment #10
Anybody@dotist: Is this fixed in 1.6?
Comment #11
Neslee Canil PintoI am not able to reproduce this issue. If it is fixed then we can close this issue.
Comment #12
huijse CreditAttribution: huijse as a volunteer commentedI am using a Drupal 9 site and a solr view with infinite scroll and keep seeing the throbber / ajax progression wheel when the results are already loaded. I see no js error in the console.
Comment #13
AnybodyIs this still an issue with 2.0.x? If yes, please update the version and set the status active again with clear steps or (best) with a test showing what's broken.
2.0.x is the active development branch.
If nobody replies, we should assume this is fixed and close this issue outdated.
Thanks!