From 67c9f137d2f99744ece3ba2a305905e5725948fb Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 25 Oct 2019 18:25:20 +0200 Subject: [PATCH] treat "0" as false as does php, our database storage and et2_checkType() --- api/js/etemplate/et2_widget_checkbox.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/et2_widget_checkbox.js b/api/js/etemplate/et2_widget_checkbox.js index 2f9133ff3a..28c4c17e96 100644 --- a/api/js/etemplate/et2_widget_checkbox.js +++ b/api/js/etemplate/et2_widget_checkbox.js @@ -139,7 +139,13 @@ var et2_checkbox = (function(){ "use strict"; return et2_inputWidget.extend( * * @param {string|boolean} _value */ - set_value: function(_value) { + set_value: function(_value) + { + // in php, our database storage and et2_checkType(): "0" == false + if (_value === "0" && this.options.selected_value != "0") + { + _value = false; + } if(_value != this.value) { if(_value == this.options.selected_value || _value && this.options.selected_value == this.attributes.selected_value["default"] &&