[TW5] Upgrade incompatibility around "modified" field

118 views
Skip to first unread message

Josh Burton

unread,
May 3, 2017, 3:26:52 AM5/3/17
to tiddl...@googlegroups.com
Hi all,

I'm a long-time user, first-time writer.  And I recently upgraded my TiddlyWiki from Classic to TW5 by using the online upgrade tool.  Everything looked great - except that some of my tiddlers mysteriously stopped displaying their timestamps.

I did some research and I think I've figured out the root of the problem (please someone correct me if I'm wrong):

1) In TW Classic, a tiddler gets its "created" field and timestamp at the moment when it is first saved.  It does not get a "modified" field and timestamp unless you subsequently change its text and save the changes.  In the river view, a tiddler is displayed with its "modified" timestamp unless it lacks a "modified" field, in which case it's displayed with the "created" timestamp.
2) In TW5, a tiddler is first "created" at the moment when its text box first appears.  It gets a "modified" field and timestamp when it is first saved.
3) The online upgrade tool doesn't seem aware of the difference between behavior 1) and 2).  It keeps track of each tiddler's "created" and "modified" fields.  But when a tiddler lacks a "modified" field (because it was created in Classic and never modified after its initial save), TW5 displays the tiddler with no timestamp in the normal river view.

There's no real loss of information here, because the tiddlers store the same data internally.  But the river display is misleading.  This doesn't seem like intended behavior.

This could be fixed with a tool/plugin that copies the "created" field into the "modified" field for all tiddlers that lack a "modified" field.  I know enough about regular expressions to create a quick hacky version of this fix for my own use, but I don't know any JavaScript so I should probably not be the one to contribute public code.  It would be awesome if this fix were part of the automated upgrade process.

Keep up the great work - I do love TiddlyWiki!

-- Josh

Birthe C

unread,
May 3, 2017, 9:25:09 AM5/3/17
to TiddlyWiki
Hi Josh,

You could edit $:/core/ui/ViewTemplate/subtitle and have it show created or modified field or both.


Birthe


Josh Burton

unread,
May 4, 2017, 1:54:24 AM5/4/17
to TiddlyWiki
Thanks Birthe!  This is helpful.  I put the following text in $:/core/ui/ViewTemplate/subtitle:

<$reveal type="nomatch" state=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<div class="tc-subtitle">
<$link to={{!!modifier}}> <$view field="modifier"/></$link>,
<$view field="created" format="date" template="DD MMM YYYY"/> -
<$view field="modified" format="date" template="DD MMM YYYY"/>
</div>
</$reveal>

This makes the timestamps look better in the subtitles of each tiddler.  But it still doesn't totally solve the problem.  For tiddlers with a "modified" field, the subtitle looks like this:

2017-05-01 - 2017-05-02

While tiddlers without a "modified" field look like this:

2017-05-01 -

Furthermore, tiddlers without a "modified" field don't show up in the "Recent" tab in the sidebar, which is weird.  I still think the best solution would be for all tabs lacking a "modified" field to have the "created" field automatically copied into the "modified" field at upgrade time.  This should be a simple enough task for a plugin.

-- Josh

Birthe C

unread,
May 4, 2017, 12:29:13 PM5/4/17
to TiddlyWiki
Hi Josh,

It actually worked for me yesterday. I had to import at lot of tiddlers from TWclassic to TW5.


<$reveal type="nomatch" state=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<div class="tc-subtitle">
<$link><$view field="creator"/></$link>
<$view field="created" format="date" template="Created: DD. MMM YYYY at hh12:0mmam"/>
@@float:right;<$link><$view field="modifier"/> </$link><$view field="modified" format="date" template="(Modified: DD. MMM YYYY at hh12:0mmam)"/>@@
</div>
</$reveal>

I think we need the time part, you could create/modify lots of tidders on the same date.


Birthe
Reply all
Reply to author
Forward
0 new messages