Open yaisog opened 1 year ago
OK, so this de-duplication seems only to happen to the list
field, so I guess it's intentional. However, since list
is the default field for the widget, it should be documented (unless it is a bug).
Seems that the same de-duplication goes for $action-setfield
when setting the list
field.
If someone can confirm that this is the intended behavior, I can prepare a doc update PR.
Also, the input to the $subfilter
of $action-listops
is de-duplicated without notice, so $subfilter
cannot be used when the list possibly contains duplicates, and one currently has to resort to $filter="[enlist:raw[...]"
to enlist the current list.
I think you should add your info to the docs. We cannot change the intrinsic behaviour because of backwards compatibility concerns. ...
There will probably be some code that relies on the current behaviour, especially as de-duplication was default for everything from the start of TW.
Duplicates where implemented at a much later date. There are probably many cases where it does not work as expected.
On the other hand, where duplicates are explicitly requested by the user they should work.
Create a tiddler with the text <$button actions="""<$action-listops $tiddler="$:/temp/listops" $filter="[[1]] =[[1]]" />""">Click</$button>
So if there is a workaround it should be documented.
So I think, the behaviour of the OP is a bug
I did not read the corresponding code, since listops is a bit hacky. ... BUT I did have a similar problem with one of my plugins, where I want to implement drag&drop sorting for filter strings, which also can have duplicates.
I think I did ended up using enlist:raw
too, but in listops functions some filters are hadcoded ... which needs to be fixed.
Describe the bug
$filter
output is de-duplicated before being written to the target field.Expected behavior
No de-duplication. Or, if it's intended, a corresponding explanation in the docs.
To Reproduce
<$button actions="""<$action-listops $tiddler="$:/temp/listops" $filter="[[1]] =[[1]]" />""">Click</$button>
list
field of$:/temp/listops
Screenshots
No response
TiddlyWiki Configuration
5.2.5
Additional context
No response