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 am running drupal 8 site and have view with infinite scroll that appears only on mobile screen.
Sometimes module duplicates last atricle from view when Automatically Load Content is set.
To clarify: I have a view with infinite scroll that display 6 atricles. When user reach the end of that view, new six articles should be loaded. Instead of that, sometimes, module load 5 new atricles with first one being same as last atricle from old atricles.
I'll attach image to explain you better.
Comments
Comment #2
nickrhymes CreditAttribution: nickrhymes commentedWe are also seeing this issue - we show X records on a page and when clicking to view more we sometimes get the last record of the previous set duplicated as the first record of the new set.
We aren't used the "auto-load more" option - we have the "click to load more" button.
This doesn't happen with every load more click, and there doesn't seem to be any consistency about which load more it happens on - sometimes 1st click for more results, sometimes 5th click, sometimes 20th etc. - however once you have found somewhere where it goes wrong for a set of views results it will consistently go wrong for that set of results in that place - e.g. refresh and click load more same number of times and you will see the error again.
We are using the latest release - 8.x-1.5
In case it is relevant, our views results set are coming from a Search API query.
Comment #3
nickrhymes CreditAttribution: nickrhymes commentedComment #4
YurkinPark CreditAttribution: YurkinPark at Skilld commentedHi, i think your site's content is refreshing very fast or output is cached. Case i'm trying to explain is 6th element on first loaded page is not 6th during obtaining next 6 elements but 7th (because of new article). Can you check this case?
Comment #5
martin.davidson CreditAttribution: martin.davidson commentedI can confirm nothing is changing and I'm also seeing this issue. It's happening on a test environment where no data is changing between page loads. The sort order was set to Authored On, and when I deleted the sort order it worked again. Whether it was because of the sort order, or it just refreshed it somehow, I'm not sure.
Comment #6
vakulrai CreditAttribution: vakulrai as a volunteer and at gai Technologies Pvt Ltd for gai Technologies Pvt Ltd commentedYou need to enable distinct in your advanced view settings .
This setting will give you unique results.
thanks's.
Comment #7
YurkinPark CreditAttribution: YurkinPark at Skilld commentedIs this still possible to reproduce? if yes - can you prepare some workarea on github which we can use to see what happens?
Comment #8
chandrahas.d CreditAttribution: chandrahas.d commentedHi , I am using Infinite scroll module in one of the site that I am working on. I have written a hook_query_alter function and have added a 'not in' condition in the array of the query object. So after writing the query alter, one row is omitted as per the query alter as a part of the 'not in' condition. So the first item of the next set, came into the last item of the current set.
So when I click on 'Load More', the last item of first list and the first item of the next set of list are the same.
I am not able to find a solution for this.
Note: I have added the distinct condition as well.
Comment #9
Neslee Canil Pinto