problem with formTiddler macro

80 views
Skip to first unread message

Seba

unread,
Apr 9, 2012, 4:42:32 AM4/9/12
to TiddlyWiki
Hi,

I am using [1] formTiddler macro to create new tiddlers using
predefined templates.

The problem occurs whenever a new tiddler name contains numbers
separated with underscores: 001_3_some title_date. In this case the
fromtiddler macro breaks and reports:

Error while executing macro <<formTiddler>>:
Tiddler expected. Got 001__2__some title__date

If the tiddler title contains just "some title" then the macro works
fine.

After further testing I found out that the problem lies in the
underscores. If I use other separators like dots or dashes it works
fine.

If you see in the example above, there appear to be 2 underscores even
though I've entered only one when creating the tiddler. So apparently
when entering the tiddler title in the prompt box given by the
formTiddler macro underscores get doubled.

How would I fix this?

regads,
seba

[1] http://tiddlywiki.abego-software.de/#FormTiddlerPlugin

cmari

unread,
Apr 9, 2012, 9:09:51 AM4/9/12
to tiddl...@googlegroups.com
Hi seba,
I use tiddlers with forms daily and all my tiddler titles include underscores, so I wonder if something else is going on.
Could you put up a minimal test case somewhere that we could see?
cmari

Seba

unread,
Apr 9, 2012, 9:22:29 AM4/9/12
to TiddlyWiki
Which version are you using? There is a difference between 2.6.1
(works) and 2.6.5 (doesn't work).

regards,
seba

Eric Shulman

unread,
Apr 9, 2012, 1:18:24 PM4/9/12
to TiddlyWiki
On Apr 9, 6:22 am, Seba <sebastjan.hri...@gmail.com> wrote:
> Which version are you using? There is a difference between 2.6.1
> (works) and 2.6.5 (doesn't work).

When rendering a tiddler, the tiddler's title is used as the ID of the
resulting DOM element (with a prefix of "tiddler" pre-pended to the
title... e.g., id="tiddlerSomeTitle"). In TW261 and earlier, the
tiddler title was used "as-is". However, certain characters are not
allowed in DOM element ID's. Unfortunately, the TWCore still created
elements that used whatever characters were in the tiddler's title,
which lead to some odd browser-level problems when the title contained
any of the non-allowed characters.

To address this, the TWCore handling was updated to 'sanitize' the
tiddler titles when generating the DOM element IDs. All dis-allowed
characters are converted to underlines, and all underlines are doubled
(to indicate the use of a literal "_" within the title). In addition,
the TWCore function, story.getTiddler(title), was updated to provide
access to the rendered DOM elements, by automatically converting to
the new ID for any given tiddler title.

The problem you are having most likely arises because, prior to TW261,
many plugins *assumed* that the ID of a rendered tiddler's DOM element
was simply the combination of the literal "tiddler" prefix and the
tiddler's title, so they attempt to retrieve a rendered tiddler's DOM
element by constructing the ID directly from the tiddler title,
without converting any special characters.

Fortunately, many plugins have been updated since then to use
"story.getTiddler(tiddler.title)" to retrieve rendered tiddler DOM
elements. So the difference in internal DOM ID naming is transparent
to them, and they work in TW2.6.5. However, if the plugin you have
installed is older, it may still be using "direct" access to the
tiddler DOM element, which would return the sanitized element ID,
rather than the expected "as-is" tiddler title.

To fix your problem, you need to contact the plugin developer and pass
along the above information so that he can update the plugin
accordingly.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

----
WAS THIS ANSWER HELPFUL? IF SO, PLEASE MAKE A DONATION
http://www.TiddlyTools.com/#Donations
note: donations are directly used to pay for food, rent,
gas, net connection, etc., so please give generously and often!

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
http://www.TiddlyTools.com/#Contact


Message has been deleted

Udo Borkowski

unread,
Apr 18, 2012, 9:40:29 PM4/18/12
to TiddlyWiki
Hi,

I just released FormTiddlerPlugin v1.0.7 and DataTiddlerPlugin
v1.0.7:

http://tiddlywiki.abego-software.de/#%5B%5BFormTiddlerPlugin%20v1.0.7%20and%20DataTiddlerPlugin%20v1.0.7%20released%5D%5D

This should fix the issue.

Thanks to Eric Shulman, Matt Shanks, Sebastjan Hribar, Terence Jacyno,
and Thomas Manley for reporting the problem or suggesting a solution.

Udo
Reply all
Reply to author
Forward
0 new messages