Index: trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.hooks.php |
— | — | @@ -474,7 +474,7 @@ |
475 | 475 | # has content different than what the user expected. However, if |
476 | 476 | # the auto-merged edit was reviewed, then assume that it's OK. |
477 | 477 | if ( $editTimestamp != $prevTimestamp |
478 | | - && !FlaggedRevision::revIsFlagged( $title, $prevRevId, FR_MASTER ) |
| 478 | + && !FlaggedRevision::revIsFlagged( $prevRevId, FR_MASTER ) |
479 | 479 | ) { |
480 | 480 | return false; // not flagged? |
481 | 481 | } |
— | — | @@ -601,7 +601,6 @@ |
602 | 602 | * (d) If the edit is neither reviewable nor patrolleable, silently mark it patrolled |
603 | 603 | */ |
604 | 604 | public static function autoMarkPatrolled( RecentChange &$rc ) { |
605 | | - global $wgUser; |
606 | 605 | if ( empty( $rc->mAttribs['rc_this_oldid'] ) ) { |
607 | 606 | return true; |
608 | 607 | } |
— | — | @@ -610,8 +609,7 @@ |
611 | 610 | // Is the page reviewable? |
612 | 611 | if ( $fa->isReviewable() ) { |
613 | 612 | $revId = $rc->mAttribs['rc_this_oldid']; |
614 | | - $quality = FlaggedRevision::getRevQuality( |
615 | | - $rc->mAttribs['rc_cur_id'], $revId, FR_MASTER ); |
| 613 | + $quality = FlaggedRevision::getRevQuality( $revId, FR_MASTER ); |
616 | 614 | // Reviewed => patrolled |
617 | 615 | if ( $quality !== false && $quality >= FR_CHECKED ) { |
618 | 616 | RevisionReviewForm::updateRecentChanges( $rc, 'patrol', $fa->getStableRev() ); |
Index: trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevision.php |
— | — | @@ -926,32 +926,29 @@ |
927 | 927 | } |
928 | 928 | |
929 | 929 | /** |
930 | | - * @param int $page_id |
931 | 930 | * @param int $rev_id |
932 | 931 | * @param $flags, FR_MASTER |
933 | 932 | * @return mixed (int or false) |
934 | 933 | * Get quality of a revision |
935 | 934 | */ |
936 | | - public static function getRevQuality( $page_id, $rev_id, $flags = 0 ) { |
| 935 | + public static function getRevQuality( $rev_id, $flags = 0 ) { |
937 | 936 | $db = ( $flags & FR_MASTER ) ? |
938 | 937 | wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE ); |
939 | 938 | return $db->selectField( 'flaggedrevs', |
940 | 939 | 'fr_quality', |
941 | | - array( 'fr_page_id' => $page_id, 'fr_rev_id' => $rev_id ), |
942 | | - __METHOD__, |
943 | | - array( 'USE INDEX' => 'PRIMARY' ) |
| 940 | + array( 'fr_rev_id' => $rev_id ), |
| 941 | + __METHOD__ |
944 | 942 | ); |
945 | 943 | } |
946 | 944 | |
947 | 945 | /** |
948 | | - * @param Title $title |
949 | 946 | * @param int $rev_id |
950 | 947 | * @param $flags, FR_MASTER |
951 | 948 | * @return bool |
952 | 949 | * Useful for quickly pinging to see if a revision is flagged |
953 | 950 | */ |
954 | | - public static function revIsFlagged( Title $title, $rev_id, $flags = 0 ) { |
955 | | - $quality = self::getRevQuality( $title->getArticleId(), $rev_id, $flags ); |
| 951 | + public static function revIsFlagged( $rev_id, $flags = 0 ) { |
| 952 | + $quality = self::getRevQuality( $rev_id, $flags ); |
956 | 953 | return ( $quality !== false ); |
957 | 954 | } |
958 | 955 | |
Index: trunk/extensions/FlaggedRevs/business/RevisionReviewForm.php |
— | — | @@ -475,6 +475,9 @@ |
476 | 476 | /** |
477 | 477 | * Update rc_patrolled fields in recent changes after (un)accepting a rev. |
478 | 478 | * This maintains the patrolled <=> reviewed relationship for reviewable namespaces. |
| 479 | + * |
| 480 | + * RecentChange should only be passed in when an RC item is saved. |
| 481 | + * |
479 | 482 | * @param $rev Revision|RecentChange |
480 | 483 | * @param $patrol string "patrol" or "unpatrol" |
481 | 484 | * @param $srev FlaggedRevsion|null The new stable version |
— | — | @@ -484,7 +487,7 @@ |
485 | 488 | global $wgUseRCPatrol; |
486 | 489 | |
487 | 490 | if ( $rev instanceof RecentChange ) { |
488 | | - $pageId = $rc->mAttribs['rc_cur_id']; |
| 491 | + $pageId = $rev->mAttribs['rc_cur_id']; |
489 | 492 | } else { |
490 | 493 | $pageId = $rev->getPage(); |
491 | 494 | } |
Index: trunk/extensions/FlaggedRevs/presentation/FlaggablePageView.php |
— | — | @@ -1568,7 +1568,7 @@ |
1569 | 1569 | protected static function getDiffRevMsgAndClass( |
1570 | 1570 | Revision $rev, FlaggedRevision $srev = null |
1571 | 1571 | ) { |
1572 | | - $tier = FlaggedRevision::getRevQuality( $rev->getPage(), $rev->getId() ); |
| 1572 | + $tier = FlaggedRevision::getRevQuality( $rev->getId() ); |
1573 | 1573 | if ( $tier !== false ) { |
1574 | 1574 | $msg = $tier |
1575 | 1575 | ? 'revreview-hist-quality' |