From: Pradeep Nayak Date: Wed, 23 Mar 2022 14:26:28 +0000 (+0000) Subject: Respect zero value X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e09f60e46ced24748d7f738eb52dfa830fdaeec3;p=civicrm-core.git Respect zero value --- diff --git a/CRM/Admin/Form/Options.php b/CRM/Admin/Form/Options.php index b5002a575e..7ee186620c 100644 --- a/CRM/Admin/Form/Options.php +++ b/CRM/Admin/Form/Options.php @@ -113,7 +113,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { // Default weight & value $fieldValues = ['option_group_id' => $this->_gid]; foreach (['weight', 'value'] as $field) { - if (empty($defaults[$field])) { + if (!isset($defaults[$field]) || $defaults[$field] === '') { $defaults[$field] = CRM_Utils_Weight::getDefaultWeight('CRM_Core_DAO_OptionValue', $fieldValues, $field); } }