srg-kostyrko / obsidian-journal

MIT License
125 stars 8 forks source link

Add Notes to Journal Journal not working for me #72

Closed cragettli closed 1 month ago

cragettli commented 1 month ago

Thank you very much for this plugin. It will replace Calendar and Periodic Notes for me. I'm looking forward for version v2! I can't add my current daily journals (created with Calendar/Periodic Notes) to journals :( The old journals are in the same folder structure as the new one: Journal/YYYY/MM/YYYY-MM-DD The add process finds the 1st Daily Note and then nothing happens :( The Debugger window shows: plugin:journals:1187 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'day') at AddNotesJournalModal.eval (plugin:journals:1187:45) at Generator.next () at fulfilled (plugin:journals:25:58) The same happens, if I change "Take date from" from "note title" to Property and set this to the "old" YAML-Field

srg-kostyrko commented 1 month ago

Could you please attach screenshot of settings that you try to use and also screenshot of second step when process starts

cragettli commented 1 month ago
Screenshot 2024-10-14 145303 - Journals Dialog Screenshot 2024-10-14 145512 - Journals working Screenshot 2024-10-14 145600 - Journals - Debug

Here are the Screenshots. Journals "stops" after finding the 1st Note to convert. "Debug-Window" is from Obsidian Debug (Chrome I think) Thank you very much and best regards!

srg-kostyrko commented 1 month ago

and could you also please expand that error by clicking on it - it probably will show more data on where it happened

cragettli commented 1 month ago

That's the expanded error obsidian.md-1728912489436.log

srg-kostyrko commented 1 month ago

thank you for the details - I was able to identify the problem I'll release a fix today or tomorrow

cragettli commented 1 month ago

Thanks a you very much Sergii!

srg-kostyrko commented 1 month ago

I release 1.4.1 that should solve this problem - please give it a try

cragettli commented 1 month ago

Thank you Sergii! Good things first: no more errors in the debug console. But still no conversion :(. The .md files are not accepted as markdown files: image

cragettli commented 1 month ago

If I connect a journal entry manually it works. It looks a little bit strange, because I had to integrate the folder in the name. At the end the not is in the same folder with the same name as before, just the necessary properties are added: image

srg-kostyrko commented 1 month ago

🤦 I was sure I checked that change that should skip processing other file formats (I noticed problem while testing) but apparently it had an issue 1.4.2 with fix is out

regarding you next comment: it happens because you defined date format with slashes inside - that was the only way to get year/month folders in periodic notes. It works in Journals as well but I generally don't recommend it (I will probably add a comment in v2 about this) - because as you see in some cases that format definition works bad a better way would be

cragettli commented 1 month ago

Perfect! Thank you very much! For v2, it would be nice (I will not use it anymore ;)), if the window which shows the progress of the connected notes (actually it doesn't): image As you suggested I changed the folder of my daily notes to {{date:YYYY}}/{{date:MM}} (root is already on "20_Special-Notes/21_Journal" and it works perfect! Thanks once more! Now I just need to fix the problem, that at the moment the new note dismiss my defined cursor position (in templater defined) on first opening

srg-kostyrko commented 1 month ago

the problem, that at the moment the new note dismiss my defined cursor position (in templater defined) on first opening

hm this may be related to how plugin integrates with templater I don't know templater that deep - could you please describe how exactly you define cursor position with templater

cragettli commented 1 month ago

I set (as described in https://dannb.org/blog/2022/obsidian-daily-note-template/):

<% tp.file.cursor() %> to tell Obsidian where to place your cursor once Templater creates each new Daily Note. To use this, place the code <% tp.file.cursor() %> wherever you want your cursor to appear (maybe on the first bullet point under Notes, or under the first daily question). Then, in Templater settings, make sure you have the following enabled:

  • Automatic jump to cursor
  • Trigger Templater on new file creation

But looked, that I meet your recommendation:

There can be cases when Templater starts interfering with plugin actions resulting in partially broken note ot journal related data removed from frontmatter. The best setup to avoid such problems would be:

  • template configured in journal plugin settings
  • Trigger Templater on new file creation is disabled
  • OR Trigger Templater on new file creation is enabled, Enable Folder Templates is enabled, NO Folder template is configured This ensures that only journal plugin is processing note template thus avoiding conflicts with templater plugin (journal plugin will use templater itself under the hood to process templater commands).

The cursor always jumps to "```calendar-nav" after opening the note. But it doesn't matter. I can (very well) live with your Plugin! Thanks alot again!

srg-kostyrko commented 1 month ago

Yeh this is definitely about integration - I'll create a separate issue to investigate on how to fix it Closing this one as the initial problem is resolved