jenkins-bot has submitted this change and it was merged.
Change subject: RefreshLinksJob: Restore LinksUpdate::setTriggeringUser() call
......................................................................
RefreshLinksJob: Restore LinksUpdate::setTriggeringUser() call
This partially reverts 22476baa85bdb70c60, as the setTriggeringUser()
call that was removed was being used by Echo to be able to determine
which user caused a LinksUpdate to be triggered.
Bug: T121780
Change-Id: I62732032a6b74f17b5ae6a2497fa519f9ff38d4f
---
M includes/jobqueue/jobs/RefreshLinksJob.php
1 file changed, 18 insertions(+), 0 deletions(-)
Approvals:
Mattflaschen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/jobqueue/jobs/RefreshLinksJob.php
b/includes/jobqueue/jobs/RefreshLinksJob.php
index 183c1ee5..c8a9892 100644
--- a/includes/jobqueue/jobs/RefreshLinksJob.php
+++ b/includes/jobqueue/jobs/RefreshLinksJob.php
@@ -222,6 +222,24 @@
$parserOutput
);
+ foreach ( $updates as $key => $update ) {
+ // FIXME: This code probably shouldn't be here?
+ // Needed by things like Echo notifications which need
+ // to know which user caused the links update
+ if ( $update instanceof LinksUpdate ) {
+ if ( !empty( $this->params['triggeringUser'] )
) {
+ $userInfo =
$this->params['triggeringUser'];
+ if ( $userInfo['userId'] ) {
+ $user = User::newFromId(
$userInfo['userId'] );
+ } else {
+ // Anonymous, use the username
+ $user = User::newFromName(
$userInfo['userName'], false );
+ }
+ $update->setTriggeringUser( $user );
+ }
+ }
+ }
+
$latestNow = $page->lockAndGetLatest();
if ( !$latestNow || $revision->getId() != $latestNow ) {
// Do not clobber over newer updates with older ones.
If all jobs where FIFO and
--
To view, visit https://gerrit.wikimedia.org/r/259774
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I62732032a6b74f17b5ae6a2497fa519f9ff38d4f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Sbisson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits