When two nodes have the exact timestamp flippy gets stuck in a loop, each image pointing to the next image!

Comments

greg.franklin’s picture

I ran into this problem and solved it by modifing the prev / next queries to this:

$prev = clone $query;
$list['prev'] = $prev
  ->condition(db_or()
    ->condition('created', $node->created, '<')
    ->condition(db_and()
      ->condition('created', $node->created, '=')
      ->condition('nid', $node->nid, '<')))
  ->orderBy('created', 'DESC')
  ->execute()->fetchAssoc();

$next = clone $query;
$list['next'] = $next
  ->condition(db_or()
    ->condition('created', $node->created, '>')
    ->condition(db_and()
      ->condition('created', $node->created, '=')
      ->condition('nid', $node->nid, '>')))
  ->orderBy('created', 'ASC')
  ->execute()->fetchAssoc();
MGParisi’s picture

Thanks can you write a .PATCH?

Schnaaf’s picture

the patch for this issue. I hope I got this right, it's my first patch...

MGParisi’s picture

Status: Active » Needs review

I was JUST thinking about this. Ill test it today:) I don't BELIEVE that is right format... did you use git?

Edit: duh, of course you used git. its close, there is instructions on the module page on how to do this http://drupal.org/project/flippy/git-instructions there is also an IRC channel... sometimes you need to wave your hands around in the contrib channel to get some help, because people dont watch it but are willing/eager to help

Schnaaf’s picture

StatusFileSize
new1.71 KB

changed the patch by following MGParisi's instructions in comment #4.

rli’s picture

StatusFileSize
new882 bytes

Error occurred when applying the patch in #5.
Rewrote the patch.

rli’s picture

StatusFileSize
new956 bytes

Logic is wrong in #6.
Rewrite the patch for #5.

adammalone’s picture

Status: Needs review » Reviewed & tested by the community

Looks good - especially for migrations where many nodes are created at the same time.

rli’s picture

Status: Reviewed & tested by the community » Fixed

committed to dev, thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.