Code that no longer works following upgrade to version 5.1.20

116 views
Skip to first unread message

mervin mecklenburg

unread,
Aug 13, 2019, 11:32:56 PM8/13/19
to TiddlyWiki
After I upgraded to version 5.1.20 from 5.1.16, the following code no longer works.

\define droppable-today(somevar)
<$action-listops $tiddler=<<actionTiddler>> $field="tags" $subfilter="-$(somevar)$"/>
\end



<$set name='somevar' value={{!!title}}>

<<list-tagged-draggable tag:$(somevar)$ subFilter:"!tag[WipDone3]">>

<$droppable actions=<<droppable-today>>>Drop here</$droppable>

In the original version, the code performed two functions.  It created a list if titles of tiddlers with a certain tag, and the list could be resorted using drag and drop.  The bottom line removed the tag, and by doing so dropped items dragged to that point from the list.  Both of these functions no longer work following the upgrade.  Can anyone explain why?

Merv

TonyM

unread,
Aug 14, 2019, 4:45:38 AM8/14/19
to TiddlyWiki
Should the subfilter not include square brackets in it to deal with titles with spaces and other delimiters?

tony

Jeremy Ruston

unread,
Aug 14, 2019, 5:00:08 AM8/14/19
to tiddl...@googlegroups.com
Hi Mervin

I’m not sure without seeing more context but I think the problem may be this fix from v5.1.18:


Previously, `$(variable)$` substitutions were performed regardless of how the macro was defined (even if it was actually defined with the set widget). Now such substitutions are only performed for macros defined with the \def pragma.

Best wishes

Jeremy.


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/c156b1b7-6165-44c5-9882-1a2162265ba2%40googlegroups.com.

Michael Wiktowy

unread,
Aug 14, 2019, 11:22:22 AM8/14/19
to TiddlyWiki
Thanks for the explanation. I was wondering what had broken with one of my projects but didn't have the time to troubleshoot. This note saved me a great deal of head-scratching.

In this case, Mervin was using it in the context of a macro call. I can see how this can be worked around using <$macrocall name=<<variable>>/> in place of the <<>> syntax.

However, in my case, I was using it in a transclusion template like {{$(variable)$||some_custom_tag_pill_tiddler}}. In looking at the instructions for the full TranscludeWidget, I can do <$transclude tiddler=<<variable>> field="title"/> but is there a way to specify the template? I was able to workaround things by making a macro like you indicated containing the above {{||}} transclusion template but am I missing something in that the full transcludeWidget is not able to use a template tiddler? I did try adding a "template=" section but it didn't work.

/Mike

On Wednesday, August 14, 2019 at 6:00:08 AM UTC-3, Jeremy Ruston wrote:
Hi Mervin

I’m not sure without seeing more context but I think the problem may be this fix from v5.1.18:


Previously, `$(variable)$` substitutions were performed regardless of how the macro was defined (even if it was actually defined with the set widget). Now such substitutions are only performed for macros defined with the \def pragma.

Best wishes

Jeremy.

On 14 Aug 2019, at 04:32, 'mervin mecklenburg' via TiddlyWiki <tiddl...@googlegroups.com> wrote:

After I upgraded to version 5.1.20 from 5.1.16, the following code no longer works.

\define droppable-today(somevar)
<$action-listops $tiddler=<<actionTiddler>> $field="tags" $subfilter="-$(somevar)$"/>
\end



<$set name='somevar' value={{!!title}}>

<<list-tagged-draggable tag:$(somevar)$ subFilter:"!tag[WipDone3]">>

<$droppable actions=<<droppable-today>>>Drop here</$droppable>

In the original version, the code performed two functions.  It created a list if titles of tiddlers with a certain tag, and the list could be resorted using drag and drop.  The bottom line removed the tag, and by doing so dropped items dragged to that point from the list.  Both of these functions no longer work following the upgrade.  Can anyone explain why?

Merv


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

Jeremy Ruston

unread,
Aug 14, 2019, 11:27:27 AM8/14/19
to tiddl...@googlegroups.com
Hi Michael



However, in my case, I was using it in a transclusion template like {{$(variable)$||some_custom_tag_pill_tiddler}}. In looking at the instructions for the full TranscludeWidget, I can do <$transclude tiddler=<<variable>> field="title"/> but is there a way to specify the template? I was able to workaround things by making a macro like you indicated containing the above {{||}} transclusion template but am I missing something in that the full transcludeWidget is not able to use a template tiddler? I did try adding a "template=" section but it didn't work.

The tiddler referenced by the transclude widget is the one that is used as a template. If you want to set a different currentTiddler for it to display then you can use the <$tiddler> widget wrapped around the transclude widget. (The {{tiddler|template]} syntax is a shortcut for a tiddler widget targeting the tiddler wrapped around a transclude widget targeting the template).

Best wishes

Jeremy

mervin mecklenburg

unread,
Aug 30, 2019, 12:12:27 PM8/30/19
to TiddlyWiki
Thank you for the reply.

I have succeeded in resolving most issues related to my inappropriate use of the code snippet $(variable)$, which caused failures after the  the upgrade, but the there remains a couple of puzzles:

First, the following code continues to work:  <<tag $(variable)$ >>.  Is this something that is harmless, or could continued use of this configuration  haunt me by failing after some future upgrade, and should I be weeding use of this configuration out of my present code?

Second, I'm having trouble finding a replacement for the use of $(variable)$ within a table of contents.  I have tried defining it in a macro; for example:

/define macroName(somevar)
<<toc-selectable-expandable $(somevar)$ >>
/end

<div>
<<macroName>>
</div>

This approach works so long as the tag being passed has no spaces, but it fails when a space is present within the tag.  I have tried all of the tricks that I know that usually work when passing spaces within a variable.  For example, I have attempted to define the variable within an accompanying macro.  I have also tried defining the macrocall widget with a secondary macro.  So far, I have not found a solution.  Does anyone have a suggestion?  How do you define a variable for use in the <<toc-selectable-expandable tag="variable">> when the variable is defined with a value that contains a space: for example, "this tag?"

Merv
Reply all
Reply to author
Forward
0 new messages