Simplify logic

This commit is contained in:
Marcus Moore 2024-08-22 12:58:35 -07:00
parent 0abb5637e0
commit 68749e7e87
No known key found for this signature in database

View file

@ -68,9 +68,9 @@ class CustomFieldSetDefaultValuesForModel extends Component
// a comma-separated string but if we're loading the page // a comma-separated string but if we're loading the page
// with old input then it was already parsed into an array. // with old input then it was already parsed into an array.
if ($field->element === 'checkbox' && is_string($defaultValue)) { if ($field->element === 'checkbox' && is_string($defaultValue)) {
$this->selectedValues[$field->db_column] = explode(', ', $defaultValue); $defaultValue = explode(', ', $defaultValue);
} else { }
$this->selectedValues[$field->db_column] = $defaultValue; $this->selectedValues[$field->db_column] = $defaultValue;
} }
}
} }