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:
parent
ee6956a5a0
commit
1d3541f785
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue