Skip to content

Commit

Permalink
Validation logic bug, required with logic hidden (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
formsdev authored Aug 16, 2023
1 parent 11ad626 commit c42c7ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Service/Forms/FormLogicPropertyResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function shouldBeRequired(): bool
}

$conditionsMet = FormLogicConditionChecker::conditionsMet($this->logic['conditions'], $this->formData);
if ($conditionsMet && $this->property['required'] && count($this->logic['actions']) > 0 && in_array('make-it-optional', $this->logic['actions'])) {
if ($conditionsMet && $this->property['required'] && count($this->logic['actions']) > 0 && (in_array('make-it-optional', $this->logic['actions']) || in_array('hide-block', $this->logic['actions']))) {
return false;
} else if ($conditionsMet && !$this->property['required'] && count($this->logic['actions']) > 0 && in_array('require-answer', $this->logic['actions'])) {
return true;
Expand Down

0 comments on commit c42c7ca

Please sign in to comment.