From: Jackmcbarn Date: Fri, 3 Jan 2014 21:11:48 +0000 (-0500) Subject: Add oldRev parameter to DiffRevisionTools hook X-Git-Tag: 1.31.0-rc.0~17106^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=25b83169c830f95a07bb1ba58d1d0c5964f8712b;p=lhc%2Fweb%2Fwiklou.git Add oldRev parameter to DiffRevisionTools hook Add a third parameter to the DiffRevisionTools hook, containing the old revision. Bug: 57721 Change-Id: I6ee956c5b9901033f618d7e4d09f8f416f3d72cb --- diff --git a/docs/hooks.txt b/docs/hooks.txt index fc4d40e3ae..8250e899b8 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -885,8 +885,9 @@ $new: the ?new= param value from the url 'DiffRevisionTools': Override or extend the revision tools available from the diff view, i.e. undo, etc. -$rev: Revision object +$newRev: Revision object of the "new" revision &$links: Array of HTML links +$oldRev: Revision object of the "old" revision (may be null) 'DiffViewHeader': Called before diff display $diff: DifferenceEngine object that's calling diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 6e74f2c8d4..abe44f75e2 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -381,7 +381,7 @@ class DifferenceEngine extends ContextSource { $rdel = $this->revisionDeleteLink( $this->mNewRev ); # Allow extensions to define their own revision tools - wfRunHooks( 'DiffRevisionTools', array( $this->mNewRev, &$revisionTools ) ); + wfRunHooks( 'DiffRevisionTools', array( $this->mNewRev, &$revisionTools, $this->mOldRev ) ); $formattedRevisionTools = array(); // Put each one in parentheses (poor man's button) foreach ( $revisionTools as $tool ) {