Eevans has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/259628

Change subject: Use Revision hook argument
......................................................................

Use Revision hook argument

Use the newly added revision argument to the TitleMoveComplete hook,
instead of attempting a lookup.

Bug: T116786
Change-Id: Iac036257aba174e6f92958867c082891d997f2f7
---
M EventBus.hooks.php
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventBus 
refs/changes/28/259628/1

diff --git a/EventBus.hooks.php b/EventBus.hooks.php
index 756d196..5318cc3 100644
--- a/EventBus.hooks.php
+++ b/EventBus.hooks.php
@@ -25,6 +25,7 @@
 
        /** Event object stub */
        private static function createEvent( $uri, $topic, $attrs ) {
+               global $wgServerName;
                $event = array(
                        'meta' => array(
                                'uri' => $uri,
@@ -168,14 +169,14 @@
         * @param string $reason reason for the move
         */
        public static function onTitleMoveComplete( Title $title, Title 
$newtitle, User $user, $oldid,
-                       $newid, $reason = null
+                       $newid, $reason = null, $newRevision
        ) {
                $attrs = array();
                $attrs['new_title'] = $newtitle->getText();
                $attrs['old_title'] = $title->getText();
                $attrs['page_id'] = $oldid;
+               $attrs['new_revision_id'] = $newRevision->getId();
                $attrs['old_revision_id'] = $newtitle->getLatestRevId();
-               $attrs['new_revision_id'] = $newtitle->getNextRevisionId( 
$attrs['old_revision_id'] );
                $attrs['user_id'] = $user->getId();
                $attrs['user_text'] = $user->getName();
                $attrs['summary'] = $reason;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac036257aba174e6f92958867c082891d997f2f7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventBus
Gerrit-Branch: master
Gerrit-Owner: Eevans <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to