From 4139dd4576c4fbd976daf86e3426c9d5441b3c90 Mon Sep 17 00:00:00 2001 From: Samuel Vanhove Date: Thu, 20 Jun 2019 22:08:37 -0400 Subject: [PATCH] dev/core#1058 simpler one line version --- CRM/Event/BAO/Event.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 46172f50bd..a207af539f 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -1640,13 +1640,7 @@ WHERE id = $cfID } // for checkboxes, change array of [key => bool] to array of [idx => key] elseif ($dao->html_type == 'CheckBox') { - $v = []; - foreach ($params[$name] as $key => $val) { - if ($val) { - $v[] = $key; - } - } - $customVal = $v; + $customVal = array_keys(array_filter($params[$name])); } else { $customVal = $params[$name]; -- 2.25.1