Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -816,11 +816,13 @@ |
817 | 817 | if( !self::qualityVersions() ) |
818 | 818 | $level = FR_SIGHTED; |
819 | 819 | # Get the latest revision ID if not set |
820 | | - if( !$latest ) |
| 820 | + if( !$latest ) { |
821 | 821 | $latest = $article->getTitle()->getLatestRevID(GAID_FOR_UPDATE); |
| 822 | + } |
822 | 823 | $pageId = $article->getId(); |
823 | | - # Update pending times for each level |
| 824 | + # Update pending times for each level, going from highest to lowest |
824 | 825 | $dbw = wfGetDB( DB_MASTER ); |
| 826 | + $higherLevelId = 0; |
825 | 827 | while( $level >= 0 ) { |
826 | 828 | # Get the latest revision of this level... |
827 | 829 | $row = $dbw->selectRow( array('flaggedrevs','revision'), |
— | — | @@ -835,10 +837,12 @@ |
836 | 838 | array( 'ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1 ) |
837 | 839 | ); |
838 | 840 | # If there is a revision of this level, track it... |
| 841 | + # Revisions reviewed to one level count as reviewed |
| 842 | + # at the lower levels (i.e. quality -> sighted). |
839 | 843 | if( $row ) { |
840 | | - $id = intval( $row->fr_rev_id ); |
| 844 | + $id = max( $higherLevelId, $row->fr_rev_id ); |
841 | 845 | # Get the timestamp of the edit after this version (if any) |
842 | | - if( $latest != $id ) { |
| 846 | + if( $latest > $id ) { |
843 | 847 | $nextTimestamp = $dbw->selectField( 'revision', |
844 | 848 | 'rev_timestamp', |
845 | 849 | array( 'rev_page' => $pageId, |
— | — | @@ -853,6 +857,7 @@ |
854 | 858 | 'fpp_pending_since' => $nextTimestamp |
855 | 859 | ); |
856 | 860 | } |
| 861 | + $higherLevelId = $id; |
857 | 862 | } |
858 | 863 | $level--; |
859 | 864 | } |