scripts icon indicating copy to clipboard operation
scripts copied to clipboard

Journal Entry Script Inserts Wrong File Name (eg. Note 12a742c7-e7e8-4e88-95ee-cca2ecb0b274)

Open patrickbolle opened this issue 3 years ago • 8 comments

Script name

Journal entry

Expected behaviour

I believe the intent of the script is to create a new note in a specified folder with the default file name of: "Journal " + m.getFullYear() + ("0" + (m.getMonth()+1)).slice(-2) + ("0" + m.getDate()).slice(-2);

eg. Journal 20210919

Actual behaviour

What happens when I click the New Journal Entry button in the Qownnotes interface is, a new journal file is created, but without the "Journal 20210919" name.

Instead, a new note is created with the file name of: Note 12a742c7-e7e8-4e88-95ee-cca2ecb0b274

etc. etc.

Steps to reproduce

  1. Install Journal Entry script
  2. Use New Journal Entry button
  3. See new journal created with your template, in proper directory, but with the wrong name.

Output from the debug section in the settings dialog

## General Info

**Current Date**: `Sun Sep 19 12:06:42 2021`
**Version**: `21.9.4`
**Build date**: `Sep 12 2021`
**Build number**: `881`
**Platform**: `linux`
**Operating System**: `Debian GNU/Linux 10 (buster)`
**Build architecture**: `x86_64`
**Current architecture**: `x86_64`
**Release**: `OBS`
**Qt Version (build)**: `5.11.3`
**Qt Version (runtime)**: `5.11.3`
**Portable mode**: `no`
**Settings path / key**: `/home/patrick/.config/PBE/QOwnNotes.conf`
**Application database path**: `/home/patrick/.local/share/PBE/QOwnNotes/QOwnNotes.sqlite`
**Application arguments**: `/usr/bin/QOwnNotes`
**Qt Debug**: `0`
**Locale (system)**: `en_CA`
**Locale (interface)**: *empty*
**Primary screen resolution**: `1920x1080`
**Screen resolution(s)**: `1920x1080, 1920x1080`
**Icon theme**: `breeze-dark-qownnotes`
**Notes in current note folder**: `51`
**Calendar items**: `11`
**Enabled scripts**: `2`
### Script `Journal entry`

**id**: `1`
**path**: `/home/patrick/.local/share/PBE/QOwnNotes/scripts/journal-entry/journal-entry.qml`
**variablesJson**: 
{
    "defaultFolder": "Daily",
    "defaultTags": "journal",
    "noteBodyTemplate": "Today... ",
    "singleJournalPerDay": true
}
**identifier**: `journal-entry`
**version**: `1.5.1`
**minAppVersion**: `17.11.6`

Relevant log output in the Log panel

[12:05:13] [scripting] creating new journal entry: Journal 20210919 [12:05:13] [scripting] Attempt: Jump to default folder 'Daily' before creating a new journal note. [12:05:13] [scripting] Success: Jump to default folder 'Daily' before creating a new journal note. [12:05:13] [status] Stored current note to disk [12:05:13] [scripting] Tag the new journal note with default tag: journal [12:05:18] [status] Stored 1 note(s) to disk

Any ideas here?

patrickbolle avatar Sep 19 '21 16:09 patrickbolle

@sanderboom

@patrickbolle, you didn't share your settings. Are you using the settings where you can change the filename of the notes?

Seems like this script lacks what I did in https://github.com/qownnotes/scripts/commit/6fa8cf0309b3a86fba80277775da6ac840e1baff.

pbek avatar Sep 19 '21 20:09 pbek

@patrickbolle, I blindly tried to fix your issue. Can you please test the new version of the script.

pbek avatar Sep 19 '21 20:09 pbek

I will close this issue until there is more information.

pbek avatar Sep 23 '21 09:09 pbek

It's always been like this for me:

  • click the new journal entry button
  • a note with hash shows up
  • after 1-2 seconds the name is changed to the right name

sanderboom avatar Sep 23 '21 10:09 sanderboom

@sanderboom, are you using the allowDifferentNoteFileName setting for your note folder?

pbek avatar Sep 23 '21 10:09 pbek

@sanderboom, are you using the allowDifferentNoteFileName setting for your note folder?

image

Ah, I see it now - so probably this is the reason/difference :heavy_check_mark:

sanderboom avatar Sep 23 '21 12:09 sanderboom

Yes, it is. 😅

pbek avatar Sep 23 '21 12:09 pbek

The current version of the script should be able to handle this.

pbek avatar Sep 23 '21 12:09 pbek

I guess this can be closed?

sanderboom avatar May 10 '23 11:05 sanderboom