Bug with selecting which field to render macro results in

For 5.2.4, the ability to choose which field the results use for displaying (I.E. title or caption) if not filled out will result in a JavaScript Error notification.

you can reproduce this by going to TiddlyWiki.com, adding a caption field to “A Gentle Guide to TiddlyWiki” with the value of ‘banana’ (just what I used out of impulse, you can choose anything.) and then using the list-links macro as such:

<<list-links '[tag[HelloThere]]' field:>>

The resulting JavaScript error
(Uncaught TypeError: Cannot read properties of undefined (reading ‘insertBefore’))
stops once you complete the macro, such as:

<<list-links '[tag[HelloThere]]' field:'title'>>

But I found it a bit concerning that while in the process of creating the macro, it will trigger an error, and was worth bringing attention to.

1 Like

It only creates the problem if you edit while the preview is visible. …

You’ll need to type faster. So the 400ms timeout doesn’t catch you :slight_smile:


Just joking. … I’ll have a closer look. From time to time it bites me too.

1 Like

What if it would look like this. Would this make sense to you?

@jeremyruston … What do you think?

I think that would be much better, having a full JavaScript error popup appear would seem like your entire tw broke, atleast for someone such as myself with scarse understanding of the internal mechanisms.

Also something of note is, if it isnt corrected, Any activity that uses JS will retrigger the popup, which further reinforces that “ooo, I really broke something” feeling.

Yea, … I did see the problem from time to time if I develop new macros, where it’s also possible to “brick” the wiki. …

The question is: Is the text clear enough, to see what’s going on? …

Any situation where the red JavaScript error dialogue is seen is automatically classed as a core bug. It is not intended to be possible for an end user to trigger a JS error dialogue without delving into JS themselves.

Filters can only return plain text so it is only possible for them to return formatted error strings. In this case, I think an empty “field” parameter should be interpreted as the “title” field.

3 Likes