Skip to content

Commit

Permalink
Fixed issue #18541: Data entry screen incorrectly assigns 0 value to …
Browse files Browse the repository at this point in the history
…empty multiflex array checkbox values (master) (PR #2765)

Fixed issue #18541: Data entry screen incorrectly assigns 0 value to empty multiflex array checkbox values (master)
  • Loading branch information
adamzammit committed Feb 21, 2023
1 parent 34d67e3 commit 857e807
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions application/controllers/admin/DataEntry.php
Expand Up @@ -1219,10 +1219,14 @@ public function editdata($subaction, $id, $surveyid)
$aDataentryoutput .= CHtml::numberField($fname['fieldname'], $idrow[$fname['fieldname']], array('step' => 'any'));
} else {
$aDataentryoutput .= "\t<select name='{$fname['fieldname']}' class='form-control'>\n";
$aDataentryoutput .= "<option value=''>...</option>\n";
$aDataentryoutput .= "<option value=''";
if ($idrow[$fname['fieldname']] === "") {
$aDataentryoutput .= " selected";
}
$aDataentryoutput .= ">...</option>\n";
for ($ii = $minvalue; $ii <= $maxvalue; $ii += $stepvalue) {
$aDataentryoutput .= "<option value='$ii'";
if ($idrow[$fname['fieldname']] == $ii) {
if ($idrow[$fname['fieldname']] === "$ii") {
$aDataentryoutput .= " selected";
}
$aDataentryoutput .= ">$ii</option>\n";
Expand Down

0 comments on commit 857e807

Please sign in to comment.