From 18b566278a45a714949cf7469724022e0dad901d Mon Sep 17 00:00:00 2001 From: btry Date: Mon, 8 Oct 2018 10:40:56 +0200 Subject: [PATCH] fix(target): actors not inserted on tarrgets Signed-off-by: btry --- inc/targetbase.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/targetbase.class.php b/inc/targetbase.class.php index bc65674c3..7ab2169ee 100644 --- a/inc/targetbase.class.php +++ b/inc/targetbase.class.php @@ -237,7 +237,7 @@ protected function prepareActors(PluginFormcreatorForm $form, PluginFormcreatorF if ($answer->isNewItem()) { continue 2; } else { - $userIds = array_filter(explode(',', trim($answer->getField('answer')))); + $userIds = json_decode($answer->fields['answer'], JSON_OBJECT_AS_ARRAY); } $notify = $actor['use_notification']; break; @@ -274,7 +274,7 @@ protected function addActor($role, $user, $notify) { $userId = 0; $alternativeEmail = $user; } else { - $userId = intval($user); + $userId = (int) $user; $alternativeEmail = ''; if ($userId == '0') { // there is no actor