jenkins-bot has submitted this change and it was merged.
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, 4 insertions(+), 2 deletions(-)
Approvals:
Aaron Schulz: Looks good to me, approved
jenkins-bot: Verified
diff --git a/EventBus.hooks.php b/EventBus.hooks.php
index 756d196..b733b7a 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,
@@ -166,16 +167,17 @@
* @param int $oldid database page_id of the page that's been moved
* @param int $newid database page_id of the created redirect, or 0 if
suppressed
* @param string $reason reason for the move
+ * @param Revision $newRevision revision created by the move
*/
public static function onTitleMoveComplete( Title $title, Title
$newtitle, User $user, $oldid,
- $newid, $reason = null
+ $newid, $reason, Revision $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: merged
Gerrit-Change-Id: Iac036257aba174e6f92958867c082891d997f2f7
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/EventBus
Gerrit-Branch: master
Gerrit-Owner: Eevans <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Eevans <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Mobrovac <[email protected]>
Gerrit-Reviewer: Ottomata <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits