Journal Button truncates existing tiddler

80 views
Skip to first unread message

Sean Boyle

unread,
May 9, 2018, 7:08:48 PM5/9/18
to TiddlyWiki
Is it just my imagination, or has this problem found its way back into TW 5.1.16?
  1. Create a journal tiddler using the new journal button
  2. close
  3. Open again using the new journal button
  4. Previous content is GONE
  5. At this point, you can close w/o saving the tiddler, and it shall appear as an existing tiddler
  6. Click the edit tiddler button and the tiddler opens with content intact

TonyM

unread,
May 9, 2018, 7:48:36 PM5/9/18
to tiddl...@googlegroups.com
Sean,

[typos fixed in post online]

I presume you have set the Title of new journal tiddlers to YYYY-MM-DD or some variant there of that does not include time.

What I have noticed on my wiki and tiddlywiki.com is that the new tiddler is created with a draft title of YYYY-MM-DD<space> which when saved, has the trailing space removed.

On a subsequent creation the new tiddler is created with a draft title of YYYY-MM-DD<space> which does not yet exist so no overwrite warning occurs, nor can the existing tiddler be opened.

If you remove the space from the title before saving it will tell you Target tiddler already exists

If you leave the extra space in the title on save it removes the space and overwrites the previous one.

So the bug that needs fixing is to remove the unwanted space from the end of the New Journal Tiddler name.

  • The extra space is not found in $:/config/NewJournal/Text 
  • It occurs in New Journal and New Journal Here
  • The fault is in the buttons
    • $:/core/ui/Buttons/new-journal
    • $:/core/ui/Buttons/new-journal-here
Edit both buttons and look for the line

<$action-sendmessage $message="tm-new-tiddler" title=<<now """$(journalTitleTemplate)$ """>>

Remove the unnecessary space from after $(journalTitleTemplate)$

This will fix it in your Wiki and we need one of the developers to submit the fix.

This has being tested at tiddlywiki.com

Regards
Tony

Diego Mesa

unread,
May 9, 2018, 8:36:49 PM5/9/18
to TiddlyWiki

TonyM

unread,
May 9, 2018, 9:44:03 PM5/9/18
to TiddlyWiki
I added my solution to there, Thanks

PMario

unread,
May 10, 2018, 3:23:35 AM5/10/18
to TiddlyWiki

On Thursday, May 10, 2018 at 1:48:36 AM UTC+2, TonyM wrote:

So the bug that needs fixing is to remove the unwanted space from the end of the New Journal Tiddler name.

  • The extra space is not found in $:/config/NewJournal/Text 
  • It occurs in New Journal and New Journal Here
  • The fault is in the buttons
    • $:/core/ui/Buttons/new-journal
    • $:/core/ui/Buttons/new-journal-here
Edit both buttons and look for the line

<$action-sendmessage $message="tm-new-tiddler" title=<<now """$(journalTitleTemplate)$ """>>
 


Nope! ... It will introduce a new bug. ... as I replied at the github issue. ... _and_ It won't fix the "new-text" for journal issue, because that's a different problem.

Do not remove the space! It will break your new-journal-button, if the title template in the ControlPanel contains a double-quote at the end. eg: test"  

-mario


PMario

unread,
May 10, 2018, 3:29:09 AM5/10/18
to TiddlyWiki
We probably need to rewrite the NewJournal buttons, so that they create new titles, if the $:/config/NewJournal/Text is existing or the tiddler is already existing. ...

-m

BurningTreeC

unread,
May 10, 2018, 3:40:57 AM5/10/18
to TiddlyWiki
@pmario 

making a PR right now - using the action-createtiddler instead of the tm-new-tiddler, which creates unique titles if the journal already exists

Jeremy Ruston

unread,
May 10, 2018, 3:55:53 AM5/10/18
to tiddl...@googlegroups.com
Apologies, I’m only just catching up with this thread, but I’ve now pushed an alternate solution that hopefully fixes the problem with the extraneous space:


Let me know how you get on,

Best wishes

Jeremy


On 10 May 2018, at 08:40, BurningTreeC <hypnotize...@gmail.com> wrote:

@pmario 

making a PR right now - using the action-createtiddler instead of the tm-new-tiddler, which creates unique titles if the journal already exists

--
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 post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/69043f9a-fa11-4856-add8-1a6b35235f2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

PMario

unread,
May 10, 2018, 4:02:49 AM5/10/18
to TiddlyWiki
Hi Jeremy,

I think, action-createtiddler is the right way to go. .. Since there are actually 2 problems. .. If the journal tiddler already exists, it will be overwritten, if the name is the same. ...

-m

Jeremy Ruston

unread,
May 10, 2018, 4:06:39 AM5/10/18
to tiddl...@googlegroups.com
Hi Mario

I think, action-createtiddler is the right way to go. .. Since there are actually 2 problems. .. If the journal tiddler already exists, it will be overwritten, if the name is the same. ...

Have you tried the fix I commited? I think it fixes the overwriting problem.

Best wishes

Jeremy.


-m

--
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 post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

PMario

unread,
May 10, 2018, 4:07:28 AM5/10/18
to TiddlyWiki
@BTC ... You may create your PR based on Jeremy's latest master :)
So we can fix both issues

-m



Jeremy Ruston

unread,
May 10, 2018, 4:09:08 AM5/10/18
to tiddl...@googlegroups.com
We can’t use action-createtiddler for this. The tm-new-journal message is specifically designed to be the means by which the new journal is created, and has different behaviour. What problem are you trying to fix with it?

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 post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

BurningTreeC

unread,
May 10, 2018, 4:11:29 AM5/10/18
to TiddlyWiki
@BTC ... You may create your PR based on Jeremy's latest master :)
So we can fix both issues

Now I understand, there's the issue with the trailing whitespace and the overwriting-problem
I'll wait a minute in case that someone is faster than me again ;) 

-m



PMario

unread,
May 10, 2018, 4:14:49 AM5/10/18
to TiddlyWiki
On Thursday, May 10, 2018 at 10:09:08 AM UTC+2, Jeremy Ruston wrote:
We can’t use action-createtiddler for this. The tm-new-journal message is specifically designed to be the means by which the new journal is created, and has different behaviour. What problem are you trying to fix with it?


Let's say a journal tiddler exists.
If a "new journal text" is defined in the $:/ControlPanel and
you create a new journal with the button ... it will overwrite the existing journal text --> that's a big problem, since it destroys existing content.

action-createtiddler can fix this. .. It creates a new name if a journal already exists.

-m




PMario

unread,
May 10, 2018, 4:34:25 AM5/10/18
to tiddl...@googlegroups.com
hihi,

OK. I'll create a PR, that combines all the proposals :) and we may clean the 3 $set-widgets and have 1 $vars instead.

-m

Jeremy Ruston

unread,
May 10, 2018, 6:29:23 AM5/10/18
to tiddl...@googlegroups.com
--
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 post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
Reply all
Reply to author
Forward
0 new messages