Beautiful Open-Source Form Builder
Validation logic bug, required with logic hidden (#164)
formsdevc42c7ca97c02
diff --git a/app/Service/Forms/FormLogicPropertyResolver.php b/app/Service/Forms/FormLogicPropertyResolver.phpindex 6e3f6f81e..b57c4ff17 100644--- a/app/Service/Forms/FormLogicPropertyResolver.php+++ b/app/Service/Forms/FormLogicPropertyResolver.php@@ -39,7 +39,7 @@ class FormLogicPropertyResolver}$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;