Beautiful Open-Source Form Builder
Fix a logic check bug if value not in form param (#70)
Chirag1d3541f785b6
diff --git a/app/Service/Forms/FormLogicConditionChecker.php b/app/Service/Forms/FormLogicConditionChecker.phpindex 14ea0dc18..ba201047b 100644--- a/app/Service/Forms/FormLogicConditionChecker.php+++ b/app/Service/Forms/FormLogicConditionChecker.php@@ -23,7 +23,7 @@ class FormLogicConditionChecker// If it's not a group, just a single conditionif (!isset($conditions['operatorIdentifier'])) {- return $this->propertyConditionMet($conditions['value'], $formData[$conditions['value']['property_meta']['id']]);+ return $this->propertyConditionMet($conditions['value'], $formData[$conditions['value']['property_meta']['id']] ?? null);}if ($conditions['operatorIdentifier'] === 'and') {@@ -102,7 +102,7 @@ class FormLogicConditionCheckerif(is_array($fieldValue)){return count($fieldValue) === 0;}- return (!$fieldValue || $fieldValue !== '' || $fieldValue !== null);+ return $fieldValue == '' || $fieldValue == null || !$fieldValue;}private function checkGreaterThan ($condition, $fieldValue): bool {