From: Frank J. Gómez Date: Wed, 16 Jul 2014 14:28:29 +0000 (-0400) Subject: CRM-14990: Don't force a value for is_reserved if it isn't passed into CRM_Core_BAO_C... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4e8506a46e6f64c07b41be3a561f426de1a238e4;p=civicrm-core.git CRM-14990: Don't force a value for is_reserved if it isn't passed into CRM_Core_BAO_CustomGroup::create(). --- 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);