Add oldRev parameter to DiffRevisionTools hook
authorJackmcbarn <jackmcbarn@gmail.com>
Fri, 3 Jan 2014 21:11:48 +0000 (16:11 -0500)
committerJackmcbarn <jackmcbarn@gmail.com>
Wed, 29 Jan 2014 01:43:55 +0000 (20:43 -0500)
Add a third parameter to the DiffRevisionTools hook, containing the old
revision.

Bug: 57721
Change-Id: I6ee956c5b9901033f618d7e4d09f8f416f3d72cb

docs/hooks.txt
includes/diff/DifferenceEngine.php

index fc4d40e..8250e89 100644 (file)
@@ -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
index 6e74f2c..abe44f7 100644 (file)
@@ -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 ) {