Skip to content

Commit

Permalink
fix(form): php warning
Browse files Browse the repository at this point in the history
when a form is filed but does not meet requirements, checkboxes are not properly populated from previous submission. A php warning occurs

Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Aug 29, 2018
1 parent 22809ce commit d0a56e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ class='formcreator_form form_horizontal'>";
foreach ($questions as $question_line) {
if (isset($data['formcreator_field_' . $question_line['id']])) {
// multiple choice question are saved as JSON and needs to be decoded
$answer = (in_array($question_line['fieldtype'], ['checkboxes', 'multiselect']))
$answer = (in_array($question_line['fieldtype'], ['multiselect']))
? json_decode($data['formcreator_field_' . $question_line['id']])
: $data['formcreator_field_' . $question_line['id']];
} else {
Expand Down

0 comments on commit d0a56e5

Please sign in to comment.