r74336 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74335‎ | r74336 | r74337 >
Date:03:41, 6 October 2010
Author:yaron
Status:deferred
Tags:
Comment:
Changed setLatestToApproved() to only approve latest if an approved revision already exists for the page
Modified paths:
  • /trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php
@@ -48,14 +48,15 @@
4949 }
5050
5151 /**
52 - * If the user saving this page has approval power, automatically
53 - * set this latest revision to be the approved one - don't bother
54 - * logging the approval, though; the log is reserved for manual
55 - * approvals.
 52+ * If this page already has an approved revision, and the user
 53+ * saving this page has approval power, automatically set this
 54+ * latest revision to be the approved one - don't bother logging
 55+ * the approval, though; the log is reserved for manual approvals.
5656 */
5757 static public function setLatestAsApproved( &$article ) {
5858 $title = $article->getTitle();
59 - if ( ! ApprovedRevs::pageIsApprovable( $title ) ) {
 59+ $approvedRevID = ApprovedRevs::getApprovedRevID( $title );
 60+ if ( empty( $approvedRevID ) ) {
6061 return true;
6162 }
6263 if ( $title->userCan( 'approverevisions' ) ) {

Status & tagging log