When you have two different draggable views, say one for ordering important blog posts and another one for the frontpage where all kinds of content types or shown, each node that is present in both views (e.g. a blog post that is important and also featured on the frontpage) will appear twice in the list.

In draggable_views_join_handler.inc I found the culprit in my case. In line 39, $view->sort[$weight_key]->options['draggableviews_setting_view'] is actually empty (and I have no clue why it shouldn't or where I could make it contain some value) and thus the view name as well as the display name will not be added to the views query's condition. If I deactivate this if clause, everything seems to works as expected.

So either this is a bug, or if it is by intention, this would be a support request asking for a documentation about the mentioned variable above. Where does it come from and how to set it to make the if clause fire?

Comments

Paul Broon created an issue.

broon’s picture

Just to make it clear: the node that appears in both standard views only appears twice in the actual view displays used for sorting, the website visitor only sees the node once in each list. Also I notice a difference between the Draggable Weight Sort modal window in the public display and the sorting display. The former shows an option to choose another view display used for sorting the results, while the latter lacks that option. I guess, this is why the variable is empty.

colinlord’s picture

I can confirm that I am also experiencing this bug where content displays twice.

colinlord’s picture

In case anybody else runs into this issue, installing this patch resolved the problem for my site on Drupal 8:
https://www.drupal.org/project/draggableviews/issues/2867159