Skip to content

Commit

Permalink
Validation logic bug, required with logic hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
formsdev committed Aug 7, 2023
1 parent 8f84faf commit 398a548
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 398a548

Please sign in to comment.