Pass change tags to NewRevisionFromEditComplete hook
authorcenarium <cenarium.sysop@gmail.com>
Fri, 10 Feb 2017 00:21:22 +0000 (01:21 +0100)
committercenarium <cenarium.sysop@gmail.com>
Fri, 10 Feb 2017 00:21:22 +0000 (01:21 +0100)
This allows extensions to pass change tags to apply to the edit
and recent change.

Change-Id: I635ffa92709ed359da2ccd52cbea2f7f7528ea07

docs/hooks.txt
includes/page/WikiPage.php

index 846a073..32270ca 100644 (file)
@@ -2256,6 +2256,7 @@ $wikiPage: the WikiPage edited
 $rev: the new revision
 $baseID: the revision ID this was based off, if any
 $user: the editing user
+&$tags: tags to apply to the edit and recent change
 
 'OldChangesListRecentChangesLine': Customize entire recent changes line, or
 return false to omit the line from RecentChanges and Watchlist special pages.
index bc936ab..27a8283 100644 (file)
@@ -1751,8 +1751,9 @@ class WikiPage implements Page, IDBAccessObject {
                                throw new MWException( "Failed to update page row to use new revision." );
                        }
 
+                       $tags = $meta['tags'];
                        Hooks::run( 'NewRevisionFromEditComplete',
-                               [ $this, $revision, $meta['baseRevId'], $user ] );
+                               [ $this, $revision, $meta['baseRevId'], $user, &$tags ] );
 
                        // Update recentchanges
                        if ( !( $flags & EDIT_SUPPRESS_RC ) ) {
@@ -1774,7 +1775,7 @@ class WikiPage implements Page, IDBAccessObject {
                                        $newsize,
                                        $revisionId,
                                        $patrolled,
-                                       $meta['tags']
+                                       $tags
                                );
                        }