jenkins-bot has submitted this change and it was merged.

Change subject: ApiPurge: Set the triggering user for the LinksUpdate
......................................................................


ApiPurge: Set the triggering user for the LinksUpdate

Even if the API call was done anonymously, we still have the IP
address to set as a triggering user. This is needed in the EventBus
since the LinksUpdate job triggers a page-properties-change event
and we need information about the performer for each page-related
event.

Bug: T147516
Bug: T147977
Change-Id: Idc6efc894698606ba528f4bd67658267ed250862
---
M includes/api/ApiPurge.php
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Mobrovac: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php
index 8bbd88d..8be523e 100644
--- a/includes/api/ApiPurge.php
+++ b/includes/api/ApiPurge.php
@@ -103,6 +103,11 @@
                                                $updates = 
$content->getSecondaryDataUpdates(
                                                        $title, null, 
$forceRecursiveLinkUpdate, $p_result );
                                                foreach ( $updates as $update ) 
{
+                                                       # Some extensions, like 
EventBus, need to know the user
+                                                       # that performed the 
purge action, so set it here
+                                                       if ( $update instanceof 
LinksUpdate ) {
+                                                               
$update->setTriggeringUser( $user );
+                                                       }
                                                        
DeferredUpdates::addUpdate( $update, DeferredUpdates::PRESEND );
                                                }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idc6efc894698606ba528f4bd67658267ed250862
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.22
Gerrit-Owner: Mobrovac <mobro...@wikimedia.org>
Gerrit-Reviewer: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Hashar <has...@free.fr>
Gerrit-Reviewer: Mobrovac <mobro...@wikimedia.org>
Gerrit-Reviewer: Ppchelko <ppche...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to