to reproduce
1) add a date time to content type
2) create content with some different, some same of that date
3) configure flippy to sort by that date
4) click previous and next
results: in one direction, all nodes displayed, in the opposite only one for each time slot is displayed

CommentFileSizeAuthor
#1 2180955-flippy-nid-1.patch499 byteshefox

Comments

hefox’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new499 bytes

sorting by nid in same direction as sort seems to fix it

rli’s picture

Status: Needs review » Postponed (maintainer needs more info)

Hi hefox,

Not sure if you are using the current dev branch but it seems so.
I followed your steps, but could not reproduce the error. This issue had been here for flippy for quite a while, we had to convert it back to SelectQuery to overcome this issue. By default, if you have the same field value for the two nodes, flippy will use nid as the sorting criteria. So in your case, if the date are the same, flippy will sort the nodes by nid.
I achieved this function by following code example in line 419:

$prev->condition(db_or()
        ->condition($sort, $node->{$sort}, $before)
        ->condition(db_and()
          ->condition($sort, $node->{$sort}, '=')
          ->condition('nid', $node->nid, $before)
        )
      );
      $next->condition(db_or()
        ->condition($sort, $node->{$sort}, $after)
        ->condition(db_and()
          ->condition($sort, $node->{$sort}, '=')
          ->condition('nid', $node->nid, $after)
        )
      );

I created 3 nodes, 2 of them are using the same date, the other one is using different date, flippy is able to go through all the nodes in either direction.

Feel free to post your idea here.

hefox’s picture

I was using a custom date field with year/month/day granulairity. Not looking at the code atm, but guessing the issue is just for fields and not core node date timestamps.

marameodesign’s picture

I am having the same issue, with custom field "year", and skips nodes with the same value.
I'm hoping to switch to sorting by weight - that would solve the issue.

https://drupal.org/comment/8432885#comment-8432885

rli’s picture

Status: Postponed (maintainer needs more info) » Patch (to be ported)

Finally was able to reproduce the error. The patch in #1 adds secondary orderBy to the query that can fix the bug.
Will apply and commit.

Thanks.

rli’s picture

Status: Patch (to be ported) » Closed (fixed)

committed to dev. Thanks.