r76889 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76888‎ | r76889 | r76890 >
Date:17:56, 17 November 2010
Author:yaron
Status:deferred
Tags:
Comment:
Fix for setLatestAsApproved() function - was setting the revision right before the latest one as the approved one, though perhaps only for MW 1.17
Modified paths:
  • /trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php
@@ -54,7 +54,10 @@
5555 * latest revision to be the approved one - don't bother logging
5656 * the approval, though; the log is reserved for manual approvals.
5757 */
58 - static public function setLatestAsApproved( &$article ) {
 58+ static public function setLatestAsApproved( &$article , &$user, $text,
 59+ $summary, $flags, $unused1, $unused2, &$flags, $revision,
 60+ &$status, $baseRevId ) {
 61+
5962 $title = $article->getTitle();
6063 if ( ! $title->userCan( 'approverevisions' ) ) {
6164 return true;
@@ -76,12 +79,8 @@
7780 return true;
7881 }
7982 }
80 - // the rev ID is actually passed in via the hook, but it's
81 - // at the end of a very long set of parameters, so for the
82 - // sake of sanity we'll just re-get it here instead
83 - $latestRevisionID = $title->getLatestRevID();
8483 // save approval without logging
85 - ApprovedRevs::saveApprovedRevIDInDB( $title, $latestRevisionID );
 84+ ApprovedRevs::saveApprovedRevIDInDB( $title, $revision->getID() );
8685 return true;
8786 }
8887

Status & tagging log