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 have duplicates and sometimes infinate loop where the same page loads over and over again!
Comments
Comment #1
MGParisi CreditAttribution: MGParisi commentedI can confirm this is not an issue with sticky, cache or anything other then infinite views:(
Comment #2
Stan Turyn CreditAttribution: Stan Turyn commentedI can confirm the duplicates problem
Comment #3
andrenoronha CreditAttribution: andrenoronha commentedI can confirm it when using random order...
Comment #4
Kazanir CreditAttribution: Kazanir commentedThis is a persistent issue that is NOT fixed by setting the Views query settings to be "distinct". It could really use a fix.
Comment #5
MGParisi CreditAttribution: MGParisi commentedThe issue happens regardless of random order.
Comment #6
x1d CreditAttribution: x1d commentedI have the same problem on a fresh installation of drupal
Comment #7
juliochile CreditAttribution: juliochile commentedI Dont know why, but It works for me to add a PHP field with just "print '';"(print nothing)
:o
Comment #8
davidwhthomas CreditAttribution: davidwhthomas commentedSame issue here, VIS is introducing duplicates to the item list.
When using a different pager there are no duplicates.
Will post here if can find a fix.
Comment #9
davidwhthomas CreditAttribution: davidwhthomas commentedNot quite sure why, but increasing the number of items per "page" resolved the duplicates issue for me.
Previously it was 6 ( two complete even rows ), changing it to 7 ( one from next row ) removed the duplicates.
Comment #10
RumpledElf CreditAttribution: RumpledElf commentedAnd yet another one with the problem.
Incidentally, I see the same thing when you change from 6 to 7 (also working with a 3-wide grid) BUT only on views with a particular number of items that return. Another view still gets duplicates. So I think you just lower your odds of duplicates dramatically with different combinations of row/pager sizes, you don't actually make the problem go away.
Comment #11
davidwhthomas CreditAttribution: davidwhthomas commented@RumpledElf, yes, in my case it was a 3 item wide row, though the rows are actually left floated 'unformatted' style view, so pretty much a vertical stack of view rows without the css left float - works nicely in a responsive design :)
It's set to show all items, 7 per page works ok, 6 per page returns duplicates.
It's an odd one.
I had a look at the JS, but seems ok.
Comment #12
RumpledElf CreditAttribution: RumpledElf commentedI'm curious - what are people using as the 'sort by' criteria here? Sort by random is a known problem, what's everyone else sorting by?
I'm sorting by draggable views order.
Comment #13
RumpledElf CreditAttribution: RumpledElf commentedGoogle is telling me that the coalesce that draggable views puts into the sort order is likely the cause of duplicates. If others with duplicates are also using a sort that triggers a coalesce, that'd be it. Look at your queries, people!
Comment #14
davidwhthomas CreditAttribution: davidwhthomas commented@RumpledElf, interesting, I'm using a draggable views sort, but it's on a field_weight integer field, will check that out though, thanks!
Comment #15
Andre-BI had a similar issue that was not related to views_infinite_scroll: after adding a relationship to flags I got duplicates shown for each flagging. adding distinct to that query helped.
Comment #16
panditvarun20 CreditAttribution: panditvarun20 commentedIn query setting i have made it distinct but no effect. should i clear cache
Comment #17
davidwhthomas CreditAttribution: davidwhthomas commentedI posted my solution here: https://drupal.org/comment/8422071#comment-8422071
Added here also for reference / googlers:
Hopefully that fixes the issue for you too.
Comment #18
panditvarun20 CreditAttribution: panditvarun20 commentedThank you davidwhthomas for your reply.
But I have still this problem..let me explain my issue
I am making a views of a content type, that shown in a block type. Now I have used infinite scroll pager for that content to show in block. But I have problem is that I get the duplicate node in my scroll while I want to show only the specified number of content to show in infinite scroll.
Please if you have any solution reply quickly.
Comment #19
panditvarun20 CreditAttribution: panditvarun20 commentedI have removed random sort criteria but it does not stop displaying duplicate content. But when I removed pager offset & random sort both then it displays the content in a right manner.
Hope this will help you.
Comment #20
vintorg CreditAttribution: vintorg commentedI am having the duplicate issue. I added a created date sort, and a node id sort. I still get the duplicate results at the end of the scroll.
Comment #21
weekbeforenextI had the same problem, but I seem to have resolved it by changing the Caching to:
Search-specific
Comment #22
gbelot2003 CreditAttribution: gbelot2003 commentedI take it back, I did 't realice that there where no scrolling :/, the problem persist.
Comment #23
frdesign CreditAttribution: frdesign commentedI tried a bunch of things but the solution quoted on #22 finally did the trick in my case.
Comment #24
lykyd CreditAttribution: lykyd commentedI tried to use #22 solution to solve my duplicates issue. But when I put the number of "Items to display" at 0 for no limit, then the views and the whole page froze.
My assumption is that Views Infinite Scroll doesn't behave like a real infinite content loader. Not giving any limit of items to display to a View just make it loading all of them, even if we use this plugin.
So because I have so many items to display, the javascript has too much to load and freezes the page.
Not sure if it's a good analysis but if it does then it means Views Infinite Scroll doesn't work the way it should (having a light page but loading just few nodes, and then load more and more as the user decide to).
In my case, I gave up using it.
Comment #25
vintorg CreditAttribution: vintorg commentedMy issue had to do with me using Views Responsive Grid. If I use on of the supported Views types, it works fine.
Comment #26
pit_zavra CreditAttribution: pit_zavra commentedHi i had the same issue and i shorted the view with first field "date created" and secont field "node id" and the proble went away.
I changed also the settings of infinity scroller to "12" items per page and "1" Number of pager links visible. I hope that helped
Comment #27
mistermastermatt CreditAttribution: mistermastermatt commentedIn my case the problem also only occurred when using random sorting. The Views Random Seed module solved it for me.
Hope this helps someone.
Comment #28
sheldonkreger CreditAttribution: sheldonkreger commentedI was also able to fix this using Views Random Seed module.
Comment #29
nyariv CreditAttribution: nyariv commentedFor me I used a File Usage: Content relationship (even though there is only one content type with one field that holds the files), which seems to have produced duplicates without views infinite scroll either. My solution was to enable aggregation in the view.
Comment #30
aramboyajyan CreditAttribution: aramboyajyan commentedI can confirm that the issue is fixed when using a more "accurate" sorting system.
We were using only the "Promoted to front page", which caused duplicates to be displayed.
Once updated to node creation date or node title, the view did not show duplicates anymore.
Comment #31
sidheswar CreditAttribution: sidheswar commented#27 worked for me. I was able to remove duplicates with Views Random Seed module.
Comment #32
deivamagalhaes CreditAttribution: deivamagalhaes for Appnovation commentedAdding an absolute sorting criterion (I've used nid) to make sure the order of the results is the same every time the query executes fixed the issue for me.
Comment #33
trentnewton CreditAttribution: trentnewton commentedI'm sorting by 'Content: Title', not using random at all and I'm getting duplicates, still after a fix for this.
Comment #34
joseph.olstadtry this first: https://www.drupal.org/node/1839474#comment-8422071
otherwise:
#2755395: Block pager does not properly load new items
Solution for me is to use this patch for views:
https://www.drupal.org/files/issues/views-pager_always_returing_first_pa...
#2754601: Pager always returning first page
issue crept in due to changes made in views between 7.x-3.13 and 7.x-3.14
Comment #35
joseph.olstadComment #36
joseph.olstadOur solution is to use this patch, in addition to adding post date to sort criteria.
the sort criteria tip is from #1839474: Duplicate Records when Sorting by Random
Comment #37
ireto CreditAttribution: ireto commentedI had the same problem. I solved it by adding another sort by field. In my case it was a title field. The initial single field was a date/time field