Fix a logic check bug if value not in form param (#70)

* Fix a logic check bug if value not in form param

* Fix isEmpty condition checker
This commit is contained in:
Chirag 2023-01-13 19:17:44 +05:30 committed by GitHub
parent ee6956a5a0
commit 1d3541f785
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ class FormLogicConditionChecker
// If it's not a group, just a single condition
if (!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 FormLogicConditionChecker
if(is_array($fieldValue)){
return count($fieldValue) === 0;
}
return (!$fieldValue || $fieldValue !== '' || $fieldValue !== null);
return $fieldValue == '' || $fieldValue == null || !$fieldValue;
}
private function checkGreaterThan ($condition, $fieldValue): bool {