Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
patrickbolle opened this issue Sep 19, 2021 · 9 comments

Comments

@patrickbolle
Copy link

patrickbolle commented Sep 19, 2021

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?

@pbek
Copy link
Member

pbek commented Sep 19, 2021

@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 6fa8cf0.

@pbek
Copy link
Member

pbek commented Sep 19, 2021

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

@pbek
Copy link
Member

pbek commented Sep 23, 2021

I will close this issue until there is more information.

@sanderboom
Copy link
Contributor

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

@pbek
Copy link
Member

pbek commented Sep 23, 2021

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

@sanderboom
Copy link
Contributor

sanderboom commented Sep 23, 2021

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

image

Ah, I see it now - so probably this is the reason/difference ✔️

@pbek
Copy link
Member

pbek commented Sep 23, 2021

Yes, it is. 😅

@pbek
Copy link
Member

pbek commented Sep 23, 2021

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

@sanderboom
Copy link
Contributor

I guess this can be closed?

@pbek pbek closed this as completed May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants