From cf28eeb2a120fe3f263235c35fe5603013f88049 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 28 Nov 2016 13:45:41 +0000 Subject: [PATCH] Fix problem with checkbox widget and empty strings If the value of `tiddler.fields[this.checkboxField]` was an empty string then it would incorrectly fall back to the value of `this.checkboxDefault`. --- core/modules/widgets/checkbox.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/modules/widgets/checkbox.js b/core/modules/widgets/checkbox.js index 2480ff319..6c1d64feb 100644 --- a/core/modules/widgets/checkbox.js +++ b/core/modules/widgets/checkbox.js @@ -65,7 +65,12 @@ CheckboxWidget.prototype.getValue = function() { } } if(this.checkboxField) { - var value = tiddler.fields[this.checkboxField] || this.checkboxDefault || ""; + var value; + if($tw.utils.hop(tiddler.fields,this.checkboxField)) { + value = tiddler.fields[this.checkboxField] || ""; + } else { + value = this.checkboxDefault || ""; + } if(value === this.checkboxChecked) { return true; }