Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -602,8 +602,7 @@ |
603 | 603 | * Updates the fp_stable and fp_reviewed fields |
604 | 604 | */ |
605 | 605 | public static function updateArticleOn( $article, $revId, $latest=NULL ) { |
606 | | - if( !$article->getId() ) |
607 | | - return true; // no bogus entries |
| 606 | + if( !$article->getId() ) return true; // no bogus entries |
608 | 607 | |
609 | 608 | $lastID = $latest ? $latest : $article->getTitle()->getLatestRevID(GAID_FOR_UPDATE); |
610 | 609 | # Get the highest quality revision (not necessarily this one) |
— | — | @@ -613,18 +612,24 @@ |
614 | 613 | array( 'fr_page_id' => $article->getId(), |
615 | 614 | 'rev_id = fr_rev_id', |
616 | 615 | 'rev_page = fr_page_id', |
617 | | - 'rev_deleted & '.Revision::DELETED_TEXT => 0 ), |
| 616 | + 'rev_deleted & '.Revision::DELETED_TEXT => 0 |
| 617 | + ), |
618 | 618 | __METHOD__, |
619 | 619 | array( 'ORDER BY' => 'fr_quality DESC', 'LIMIT' => 1 ) |
620 | 620 | ); |
621 | 621 | # Get the timestamp of the edit after the stable version (if any) |
622 | | - $nextTimestamp = $dbw->selectField( 'revision', |
623 | | - 'rev_timestamp', |
624 | | - array( 'rev_page' => $article->getId(), |
625 | | - "rev_id > ".intval($revId) ), |
626 | | - __METHOD__, |
627 | | - array( 'ORDER BY' => 'rev_id ASC', 'LIMIT' => 1 ) |
628 | | - ); |
| 622 | + if( $lastID != $revId ) { |
| 623 | + $timestamp = Revision::getTimestampFromId( $article->getTitle(), $revId ); |
| 624 | + $nextTimestamp = $dbw->selectField( 'revision', |
| 625 | + 'rev_timestamp', |
| 626 | + array( 'rev_page' => $article->getId(), |
| 627 | + "rev_timestamp > ".$dbw->strencode( $dbw->timestamp($timestamp) ) ), |
| 628 | + __METHOD__, |
| 629 | + array( 'ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 1 ) |
| 630 | + ); |
| 631 | + } else { |
| 632 | + $nextTimestamp = null; |
| 633 | + } |
629 | 634 | # Alter table metadata |
630 | 635 | $dbw->replace( 'flaggedpages', |
631 | 636 | array( 'fp_page_id' ), |