From 4e8506a46e6f64c07b41be3a561f426de1a238e4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Frank=20J=2E=20G=C3=B3mez?= Date: Wed, 16 Jul 2014 10:28:29 -0400 Subject: [PATCH] CRM-14990: Don't force a value for is_reserved if it isn't passed into CRM_Core_BAO_CustomGroup::create(). --- CRM/Core/BAO/CustomGroup.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index 7d10aba147..1bf03e1988 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -160,14 +160,14 @@ class CRM_Core_BAO_CustomGroup extends CRM_Core_DAO_CustomGroup { } } - $is_reserved = CRM_Utils_Array::value('is_reserved', $params, 0); - if (in_array($is_reserved, array(TRUE, 1, '1'), TRUE)) { - $is_reserved = 1; - } else { - $is_reserved = 0; + if (array_key_exists('is_reserved', $params)) { + if (in_array($params['is_reserved'], array(TRUE, 1, '1'), TRUE)) { + $is_reserved = 1; + } else { + $is_reserved = 0; + } + $group->is_reserved = $is_reserved; } - $group->is_reserved = $is_reserved; - $op = isset($params['id']) ? 'edit' : 'create'; CRM_Utils_Hook::pre($op, 'CustomGroup', CRM_Utils_Array::value('id', $params), $params); -- 2.25.1