From: Aaron Schulz Date: Sun, 21 Dec 2008 08:49:45 +0000 (+0000) Subject: Improve markpatrolled hook X-Git-Tag: 1.31.0-rc.0~43852 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=c29b5243ab8f255c3ded4785551e9cd0f29cabd7;p=lhc%2Fweb%2Fwiklou.git Improve markpatrolled hook --- diff --git a/docs/hooks.txt b/docs/hooks.txt index c9daed90fe..41f5587c0b 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -897,7 +897,7 @@ $variableIDs: array of strings of Skin::makeVariablesScript 'MarkPatrolled': before an edit is marked patrolled -$rcid: ID of the revision to be marked patrolled +$rc: RecentChange object 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 diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 010770cc43..ff4624fc76 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -268,7 +268,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->getAttribute('rc_id'), &$wgUser, false)) ) { + if( !wfRunHooks('MarkPatrolled', array($this, &$wgUser, false)) ) { $errors[] = array('hookaborted'); } // Users without the 'autopatrol' right can't patrol their