Operators work inconsistently #3117

23 views
Skip to first unread message

Stephan Hradek

unread,
Feb 14, 2018, 8:21:02 AM2/14/18
to TiddlyWikiDev
I just opened issue #3117:

Please compare the descriptions of the parameter of the "sort" and "each" operator. They both state:

F = the name of a field, defaulting to title

Nevertheless, the output of these tiddlers is different if you put it into a "New tiddler":


<$list filter="[[New Tiddler]] [[test]] +[sort[]]">

</$list>
----
<$list filter="[[New Tiddler]] [[test]] +[each[]]">

</$list>
 

"each" will silently drop "test" as it is not existing and thus has no real "title" field, while "sort" will happily sort "test". "sort" will even do it when you call it as "+[sort[title]]".

We should resolve inconsistencies like this.

My PR #3116 doesn't help much in this inconsistency, as it treats "each[]" and "each[title]" differently.

My Proposal is to either define that each non-existing tiddler has a title field (like "search" does) or that they don't in which case we should treat any "operator[]" differently than "operator[title]".

Reply all
Reply to author
Forward
0 new messages