From: Petr Pchelko Date: Wed, 12 Oct 2016 21:20:29 +0000 (-0700) Subject: ApiPurge: Set the triggering user for the LinksUpdate X-Git-Tag: 1.31.0-rc.0~5127 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=84ffa5d1242fd28f9288a1be9199f64cb50cc920;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php index 8bbd88dfec..8be523e919 100644 --- a/includes/api/ApiPurge.php +++ b/includes/api/ApiPurge.php @@ -103,6 +103,11 @@ class ApiPurge extends ApiBase { $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 ); }