From 25b83169c830f95a07bb1ba58d1d0c5964f8712b Mon Sep 17 00:00:00 2001 From: Jackmcbarn Date: Fri, 3 Jan 2014 16:11:48 -0500 Subject: [PATCH] Add oldRev parameter to DiffRevisionTools hook Add a third parameter to the DiffRevisionTools hook, containing the old revision. Bug: 57721 Change-Id: I6ee956c5b9901033f618d7e4d09f8f416f3d72cb --- docs/hooks.txt | 3 ++- includes/diff/DifferenceEngine.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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 ) { -- 2.20.1