Cenarium has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328027 )

Change subject: Pass undone revision id to PageContentSaveComplete hook
......................................................................

Pass undone revision id to PageContentSaveComplete hook

This passes the id of the revision that was undone to the
PageContentSaveComplete hook, since this hook is now inside a deferred
update so extensions can no longer rely on 'wpUndidRevision' being
present in the request.

Change-Id: I50dcb841cd0616acc2d69c3a685ba3cb339986c3
---
M includes/EditPage.php
M includes/page/WikiPage.php
2 files changed, 8 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/27/328027/1

diff --git a/includes/EditPage.php b/includes/EditPage.php
index f37ce34..0ccd052 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -2142,7 +2142,8 @@
                        false,
                        $wgUser,
                        $content->getDefaultFormat(),
-                       $this->changeTags
+                       $this->changeTags,
+                       $this->undidRev
                );
 
                if ( !$doEditStatus->isOK() ) {
diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index 924a395..957520d 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -1634,6 +1634,7 @@
         * @param array|null $tags Change tags to apply to this edit
         * Callers are responsible for permission checks
         * (with ChangeTags::canAddTagsAccompanyingChange)
+        * @param Int $undidRevId Id of revision that was undone or 0
         *
         * @throws MWException
         * @return Status Possible errors:
@@ -1655,7 +1656,7 @@
         */
        public function doEditContent(
                Content $content, $summary, $flags = 0, $baseRevId = false,
-               User $user = null, $serialFormat = null, $tags = []
+               User $user = null, $serialFormat = null, $tags = [], 
$undidRevId = 0
        ) {
                global $wgUser, $wgUseAutomaticEditSummaries;
 
@@ -1734,7 +1735,8 @@
                        'oldId' => $this->getLatest(),
                        'oldIsRedirect' => $this->isRedirect(),
                        'oldCountable' => $this->isCountable(),
-                       'tags' => ( $tags !== null ) ? (array)$tags : []
+                       'tags' => ( $tags !== null ) ? (array)$tags : [],
+                       'undidRevId' => $undidRevId
                ];
 
                // Actually create the revision and create/update the page
@@ -1914,7 +1916,8 @@
                                        );
                                        // Trigger post-save hook
                                        $params = [ &$this, &$user, $content, 
$summary, $flags & EDIT_MINOR,
-                                               null, null, &$flags, $revision, 
&$status, $meta['baseRevId'] ];
+                                               null, null, &$flags, $revision, 
&$status, $meta['baseRevId'],
+                                               $meta['undidRevId'] ];
                                        ContentHandler::runLegacyHooks( 
'ArticleSaveComplete', $params );
                                        Hooks::run( 'PageContentSaveComplete', 
$params );
                                }

-- 
To view, visit https://gerrit.wikimedia.org/r/328027
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I50dcb841cd0616acc2d69c3a685ba3cb339986c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Cenarium <cenarium.sy...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to