From 99c5fa46dd74fe814c52ef7f7b06738cd07ef02a Mon Sep 17 00:00:00 2001 From: Andreas Hahn Date: Sun, 27 Sep 2015 15:35:54 +0200 Subject: [PATCH] fixed bug in $action-setfield introduced by #1963: At least one of '$field', '$value' or '$index' must be specified in order to act upon the information from the fields. Prevents default deletion of the 'text' field when none are specified. --- core/modules/widgets/action-setfield.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/modules/widgets/action-setfield.js b/core/modules/widgets/action-setfield.js index 1e1ba6d8e..98079f00c 100644 --- a/core/modules/widgets/action-setfield.js +++ b/core/modules/widgets/action-setfield.js @@ -61,7 +61,9 @@ SetFieldWidget.prototype.invokeAction = function(triggeringWidget,event) { var self = this, options = {}; options.suppressTimestamp = !this.actionTimestamp; - this.wiki.setText(this.actionTiddler,this.actionField,this.actionIndex,this.actionValue,options); + if((typeof this.actionField == "string") || (typeof this.actionIndex == "string") || (typeof this.actionValue == "string")) { + this.wiki.setText(this.actionTiddler,this.actionField,this.actionIndex,this.actionValue,options); + } $tw.utils.each(this.attributes,function(attribute,name) { if(name.charAt(0) !== "$") { self.wiki.setText(self.actionTiddler,name,undefined,attribute,options);