From dbd3f835bf8399ed1a3da7cc322ec9b6ab783d53 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Wed, 19 May 2021 14:10:39 +0100 Subject: [PATCH] Fix crash when sorting by non-string fields tags, list, created, modified are not stored as strings by default. Fixes #5701 --- core/modules/wiki.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/wiki.js b/core/modules/wiki.js index 54c3f0810..81459dbc1 100755 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -374,12 +374,12 @@ exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,is var tiddlerA = self.getTiddler(a), tiddlerB = self.getTiddler(b); if(tiddlerA) { - a = tiddlerA.fields[sortField] || ""; + a = tiddlerA.getFieldString(sortField) || ""; } else { a = ""; } if(tiddlerB) { - b = tiddlerB.fields[sortField] || ""; + b = tiddlerB.getFieldString(sortField) || ""; } else { b = ""; }