From e09f60e46ced24748d7f738eb52dfa830fdaeec3 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Wed, 23 Mar 2022 14:26:28 +0000 Subject: [PATCH] Respect zero value --- CRM/Admin/Form/Options.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Admin/Form/Options.php b/CRM/Admin/Form/Options.php index b5002a575e0a..7ee186620cc2 100644 --- a/CRM/Admin/Form/Options.php +++ b/CRM/Admin/Form/Options.php @@ -113,7 +113,7 @@ public function setDefaultValues() { // 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); } }