Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -584,8 +584,7 @@ |
585 | 585 | if( !$flaggedArticle->showStableByDefault() ) { |
586 | 586 | return true; |
587 | 587 | } |
588 | | - $frev = $flaggedArticle->getStableRev(); |
589 | | - if( $frev ) { |
| 588 | + if( $frev = $flaggedArticle->getStableRev() ) { |
590 | 589 | # Allow for only editors/reviewers to move this |
591 | 590 | if( !$user->isAllowed('review') && !$user->isAllowed('movestable') ) { |
592 | 591 | $result = false; |
— | — | @@ -652,7 +651,7 @@ |
653 | 652 | # Avoid extra DB hit and lag issues |
654 | 653 | $title->resetArticleID( $rev->getPage() ); |
655 | 654 | # Get what was just the current revision ID |
656 | | - $prevRevId = self::getPreviousRevisionId( $rev ); |
| 655 | + $prevRevId = $rev->getParentId(); |
657 | 656 | # Get the revision ID the incoming one was based off... |
658 | 657 | if( !$baseRevId && $prevRevId ) { |
659 | 658 | $prevTimestamp = Revision::getTimestampFromId( $title, $prevRevId ); // use PK |
— | — | @@ -701,28 +700,9 @@ |
702 | 701 | } |
703 | 702 | return true; |
704 | 703 | } |
705 | | - |
706 | | - /** |
707 | | - * As used, this function should be lag safe |
708 | | - * @param Revision $revision |
709 | | - * @return int |
710 | | - */ |
711 | | - protected static function getPreviousRevisionID( $revision ) { |
712 | | - $db = wfGetDB( DB_MASTER ); |
713 | | - return $db->selectField( 'revision', 'rev_id', |
714 | | - array( |
715 | | - 'rev_page' => $revision->getPage(), |
716 | | - 'rev_id < ' . $revision->getId() |
717 | | - ), |
718 | | - __METHOD__, |
719 | | - array( 'ORDER BY' => 'rev_id DESC' ) |
720 | | - ); |
721 | | - } |
722 | 704 | |
723 | 705 | /** |
724 | 706 | * When an edit is made to a page that can't be reviewed, autopatrol if allowed. |
725 | | - * This is not loggged for perfomance reasons and no one cares if talk pages and such |
726 | | - * are autopatrolled. |
727 | 707 | */ |
728 | 708 | public static function autoMarkPatrolled( $rc ) { |
729 | 709 | global $wgUser; |