I have duplicates and sometimes infinate loop where the same page loads over and over again!

Comments

MGParisi’s picture

I can confirm this is not an issue with sticky, cache or anything other then infinite views:(

Stan Turyn’s picture

I can confirm the duplicates problem

andrenoronha’s picture

I can confirm it when using random order...

Kazanir’s picture

Title: Infinate Loop and duplicates » Infinite Scroll, random order, and duplicates

This is a persistent issue that is NOT fixed by setting the Views query settings to be "distinct". It could really use a fix.

MGParisi’s picture

Title: Infinite Scroll, random order, and duplicates » Infinite Scroll and duplicates

The issue happens regardless of random order.

x1d’s picture

I have the same problem on a fresh installation of drupal

juliochile’s picture

I Dont know why, but It works for me to add a PHP field with just "print '';"(print nothing)

:o

davidwhthomas’s picture

Same 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.

davidwhthomas’s picture

Not 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.

RumpledElf’s picture

And 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.

davidwhthomas’s picture

@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.

RumpledElf’s picture

I'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.

RumpledElf’s picture

Google 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!

davidwhthomas’s picture

@RumpledElf, interesting, I'm using a draggable views sort, but it's on a field_weight integer field, will check that out though, thanks!

Andre-B’s picture

I 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.

panditvarun20’s picture

In query setting i have made it distinct but no effect. should i clear cache

davidwhthomas’s picture

I posted my solution here: https://drupal.org/comment/8422071#comment-8422071

Added here also for reference / googlers:

In my case, I was sorting in views by a weight field from draggableviews.

I added a second sort criteria of "Post date: created date" descending.

This means that even if two nodes have the same weight (e.g default 0) then they still get a unique sort, assuming the node created timestamp varies.

It fixed the duplicate item issue I was having.

Hopefully that fixes the issue for you too.

panditvarun20’s picture

Thank 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.

panditvarun20’s picture

I 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.

vintorg’s picture

Issue summary: View changes

I 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.

weekbeforenext’s picture

Status: Active » Closed (fixed)

I had the same problem, but I seem to have resolved it by changing the Caching to:

Search-specific

  • Query results: Never cache
  • Rendered output: 6 days
gbelot2003’s picture

Found the problem, in my case, I used "Items per page" with 6 elements, and "Number of pager links visible" 6 too, so, I set "Items per page" with 0 that is infinite elements and the repetition problem just desapear...

I take it back, I did 't realice that there where no scrolling :/, the problem persist.

frdesign’s picture

I tried a bunch of things but the solution quoted on #22 finally did the trick in my case.

lykyd’s picture

I 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.

vintorg’s picture

My issue had to do with me using Views Responsive Grid. If I use on of the supported Views types, it works fine.

pit_zavra’s picture

Hi 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

mistermastermatt’s picture

In my case the problem also only occurred when using random sorting. The Views Random Seed module solved it for me.

Hope this helps someone.

sheldonkreger’s picture

I was also able to fix this using Views Random Seed module.

nyariv’s picture

For 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.

aramboyajyan’s picture

I 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.

sidheswar’s picture

#27 worked for me. I was able to remove duplicates with Views Random Seed module.

deivamagalhaes’s picture

Adding 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.

trentnewton’s picture

I'm sorting by 'Content: Title', not using random at all and I'm getting duplicates, still after a fix for this.

joseph.olstad’s picture

joseph.olstad’s picture

joseph.olstad’s picture

Our 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

ireto’s picture

I 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