Matthias Mullie has uploaded a new change for review.

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

Change subject: Accomodate for when no users-to-watch-topic are defined for an 
action
......................................................................

Accomodate for when no users-to-watch-topic are defined for an action

Actions like supress-post will also go through the listener to
see if the topic should be watched. However, when no users need to
be subscribed to a topic after a certain action, the value returned
by $actions->getValue() will be NULL.

onAfterInsertExpectedChange expects that return value to be an array
that it will iterate over, so let's just fix that ;)

Change-Id: I5bd9983f427dfe683b10e055b098212807baaa1b
---
M includes/Data/WatchTopicListener.php
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/57/155557/1

diff --git a/includes/Data/WatchTopicListener.php 
b/includes/Data/WatchTopicListener.php
index 99b9dcf..0d6df59 100644
--- a/includes/Data/WatchTopicListener.php
+++ b/includes/Data/WatchTopicListener.php
@@ -69,6 +69,11 @@
                        return array();
                }
 
+               // Null will be returned if nothing is defined for this 
changeType
+               if ( !$users ) {
+                       return array();
+               }
+
                // Some actions may have more complex logic to determine 
watching users
                if ( is_callable( $users ) ) {
                        $users = call_user_func_array( $users, $params );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5bd9983f427dfe683b10e055b098212807baaa1b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to