Revert r44867 "Improve markpatrolled hook"
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 23 Dec 2008 20:56:19 +0000 (20:56 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 23 Dec 2008 20:56:19 +0000 (20:56 +0000)
Incompatible change to existing hook (changing types of parameters passed)

docs/hooks.txt
includes/RecentChange.php

index 7b57de4..fa3c011 100644 (file)
@@ -891,7 +891,7 @@ $variableIDs: array of strings
                of Skin::makeVariablesScript
 
 'MarkPatrolled': before an edit is marked patrolled
-$rc: RecentChange object of the revision to be marked patrolled
+$rcid: ID of the revision to be marked patrolled
 $user: the user (object) marking the revision as patrolled
 $wcOnlySysopsCanPatrol: config setting indicating whether the user
  needs to be a sysop in order to mark an edit patrolled
index 1536dc6..f03fbcb 100644 (file)
@@ -270,7 +270,7 @@ class RecentChange
                // Automatic patrol needs "autopatrol", ordinary patrol needs "patrol"
                $right = $auto ? 'autopatrol' : 'patrol';
                $errors = array_merge( $errors, $this->getTitle()->getUserPermissionsErrors( $right, $wgUser ) );
-               if( !wfRunHooks('MarkPatrolled', array($this, &$wgUser, false)) ) {
+               if( !wfRunHooks('MarkPatrolled', array($this->getAttribute('rc_id'), &$wgUser, false)) ) {
                        $errors[] = array('hookaborted');
                }
                // Users without the 'autopatrol' right can't patrol their