]> _ Git - cubist_cms-back.git/commitdiff
wait #6661 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 23 Jan 2024 15:21:17 +0000 (16:21 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 23 Jan 2024 15:21:17 +0000 (16:21 +0100)
src/resources/views/when.blade.php

index 4bdb8befc46f99e7230b40ea21525d74a429efdf..99d17ec34e133b2b7af248de862694b5ae51d4d1 100644 (file)
             };
 
             function checkCondition(condition, operator, val) {
-                if (condition.id === '_not_empty_' || condition.operator === 'not_empty') {
-                    return val.toString().length > 0;
-                }
-                if (operator === '=') {
-                    return condition.id == val;
-                }
-                if (operator === '!=' || operator === '!') {
-                    return condition.id != val;
+                try {
+                    if (condition.id === undefined) {
+                        condition.id = '';
+                    }
+                    if (condition.id === '_not_empty_' || condition.operator === 'not_empty') {
+                        return val.toString().length > 0;
+                    }
+                    if (operator === '=') {
+                        return condition.id == val;
+                    }
+                    if (operator === '!=' || operator === '!') {
+                        return condition.id != val;
+                    }
+                } catch (e) {
+                    return true;
                 }
             }
 
                         if (!isObject(condition)) {
                             condition = {id: condition};
                         }
+                        if (!condition.hasOwnProperty('id')) {
+                            condition.id = '';
+                        }
                         if (!condition.hasOwnProperty('order')) {
                             condition.order = k;
                         }