From 9bb5fd0190a345ae7f27c63a01696d6ecdc997e4 Mon Sep 17 00:00:00 2001 From: Rob Hoelz Date: Thu, 28 Mar 2024 07:32:12 -0500 Subject: [PATCH] Only update modified field if we actually delete a field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …in the <$action-deletefield /> widget. Fixes a bug where <$action-deletefield foo /> would update the modified field if the "foo" field wasn't present on a tiddler. --- core/modules/widgets/action-deletefield.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/modules/widgets/action-deletefield.js b/core/modules/widgets/action-deletefield.js index 54068471e..9e2430b88 100644 --- a/core/modules/widgets/action-deletefield.js +++ b/core/modules/widgets/action-deletefield.js @@ -69,7 +69,9 @@ DeleteFieldWidget.prototype.invokeAction = function(triggeringWidget,event) { $tw.utils.each(this.attributes,function(attribute,name) { if(name.charAt(0) !== "$" && name !== "title") { removeFields[name] = undefined; - hasChanged = true; + if(name in tiddler.fields) { + hasChanged = true; + } } }); if(hasChanged) {