Skip to content

Commit

Permalink
Merge pull request #23016 from pradpnayak/optionValue
Browse files Browse the repository at this point in the history
Respect zero value
  • Loading branch information
colemanw authored Apr 7, 2022
2 parents 34751e6 + e09f60e commit b991cdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CRM/Admin/Form/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit b991cdb

Please sign in to comment.