Ppchelko has uploaded a new change for review.

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

Change subject: Don't set the performer property if the user is not available.
......................................................................

Don't set the performer property if the user is not available.

Change-Id: I71eff9099652f7819da0506f2220521f1f1707d2
Depends-On: I139f12ae3f592dcf690617f9dd95a4df828c4a70
---
M EventBus.hooks.php
1 file changed, 5 insertions(+), 1 deletion(-)


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

diff --git a/EventBus.hooks.php b/EventBus.hooks.php
index ee3a733..3a8b25f 100644
--- a/EventBus.hooks.php
+++ b/EventBus.hooks.php
@@ -641,12 +641,12 @@
 
                $title = $linksUpdate->getTitle();
                $revision = $linksUpdate->getRevision();
+               $user = $linksUpdate->getTriggeringUser();
 
                // Create a mediawiki page delete event.
                $attrs = [
                        // Common Mediawiki entity fields
                        'database'           => $wgDBname,
-                       'performer'          => self::createPerformerAttrs( 
$linksUpdate->getTriggeringUser() ),
 
                        // page entity fields
                        'page_id'            => $title->getArticleID(),
@@ -656,6 +656,10 @@
                        'rev_id'             =>$revision->getId()
                ];
 
+               if ( !is_null( $user ) ) {
+                       $attrs[ 'performer' ] = self::createPerformerAttrs( 
$user );
+               }
+
                if ( !empty( $addedProps ) ) {
                        $attrs[ 'added_properties' ] = $addedProps;
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I71eff9099652f7819da0506f2220521f1f1707d2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventBus
Gerrit-Branch: master
Gerrit-Owner: Ppchelko <ppche...@wikimedia.org>

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

Reply via email to