From 4620b5fd258f1df04afd7b7fc249a7e0e9116fd0 Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Mon, 12 May 2025 02:16:54 -0400 Subject: [PATCH] Make `tags.none:` filter work again (#3877) * Don't remove the legacy 'tags' property * Simulate the `tags` DOM property This refers to the deprecated "tags" property of tasks. This property usually still exists, for compatibility with older versions, but should not be relied on anymore. --- src/DOM.cpp | 7 +++++++ src/commands/CmdEdit.cpp | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/DOM.cpp b/src/DOM.cpp index fe47f2878..31a8e5dc0 100644 --- a/src/DOM.cpp +++ b/src/DOM.cpp @@ -286,6 +286,13 @@ bool getDOM(const std::string& name, const Task* task, Variant& value) { return true; } + // The "tags" property is deprecated, but it is documented as part of the DOM, so simulate it. + if (size == 1 && canonical == "tags") { + auto tags = ref->getTags(); + value = Variant(join(",", tags)); + return true; + } + Column* column = Context::getContext().columns[canonical]; if (size == 1 && column) { diff --git a/src/commands/CmdEdit.cpp b/src/commands/CmdEdit.cpp index 8f6e85927..b6535f1aa 100644 --- a/src/commands/CmdEdit.cpp +++ b/src/commands/CmdEdit.cpp @@ -317,7 +317,6 @@ void CmdEdit::parseTask(Task& task, const std::string& after, const std::string& // tags value = findValue(after, "\n Tags:"); - task.remove("tags"); task.setTags(split(value, ' ')); // description.