From: Vincent Vanwaelscappel Date: Tue, 23 Jan 2024 15:21:17 +0000 (+0100) Subject: wait #6661 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=596321078e3b9d9c113b5b03300f0d14cc737c06;p=cubist_cms-back.git wait #6661 @0.25 --- diff --git a/src/resources/views/when.blade.php b/src/resources/views/when.blade.php index 4bdb8be..99d17ec 100644 --- a/src/resources/views/when.blade.php +++ b/src/resources/views/when.blade.php @@ -81,14 +81,21 @@ }; 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; } } @@ -125,6 +132,9 @@ if (!isObject(condition)) { condition = {id: condition}; } + if (!condition.hasOwnProperty('id')) { + condition.id = ''; + } if (!condition.hasOwnProperty('order')) { condition.order = k; }