Skip to content

Commit

Permalink
fix(checkboxes): avoid error when computing tooltip
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <[email protected]>
  • Loading branch information
btry committed Jun 17, 2021
1 parent 14a991b commit f054bbc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion inc/field/checkboxesfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public function getValueForTargetText($domain, $richText): ?string {
$value = [];
$values = $this->getAvailableValues();

if ($values === null || count($this->value) === 0) {
if ($values === null || $this->value === null || count($this->value) === 0) {
return '';
}

Expand Down
3 changes: 3 additions & 0 deletions inc/formanswer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,9 @@ public function deserializeAnswers() : bool {

$answers_values = $this->getAnswers($this->getID());
foreach (array_keys($this->questionFields) as $id) {
if (!$this->questionFields[$id]->hasInput($answers_values)) {
continue;
}
$this->questionFields[$id]->deserializeValue($answers_values['formcreator_field_' . $id]);
}

Expand Down

0 comments on commit f054bbc

Please sign in to comment.