Skip to content

Commit

Permalink
Cast radio button options as array when loading them (so lack of opti…
Browse files Browse the repository at this point in the history
…ons is OK)
  • Loading branch information
jegelstaff committed Jul 30, 2024
1 parent 4dd02d9 commit 852f75a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/formulize/include/formdisplay.php
Original file line number Diff line number Diff line change
Expand Up @@ -2994,7 +2994,7 @@ function loadValue($prevEntry, $element, $ele_value, $owner_groups, $entry_id) {
}
}
}
if ($type == "radio" AND $entry_id != "new" AND ($value === "" OR is_null($value)) AND array_search(1, $ele_value)) { // for radio buttons, if we're looking at an entry, and we've got no value to load, but there is a default value for the radio buttons, then use that default value (it's normally impossible to unset the default value of a radio button, so we want to ensure it is used when rendering the element in these conditions)
if ($type == "radio" AND $entry_id != "new" AND ($value === "" OR is_null($value)) AND array_search(1, (array) $ele_value)) { // for radio buttons, if we're looking at an entry, and we've got no value to load, but there is a default value for the radio buttons, then use that default value (it's normally impossible to unset the default value of a radio button, so we want to ensure it is used when rendering the element in these conditions)
$ele_value = $ele_value;
} elseif ($type != "select")
{
Expand Down

0 comments on commit 852f75a

Please sign in to comment.