quickadd
quickadd copied to clipboard
[BUG] Template path is not saved
Describe the bug Relatively new user of Obsidian, so I'm still configuring and iterating a lot, also with the QuickAdd plugin.
When adding a new choice, I often see that the Template path value doesn't "stick" when being configured. I can change it, but when using the Quickadd command afterwards, I get an "invalid template path" error that still refers to the old value.
Restarting Obsidian sometimes helps: I can usually make one adjustment and that is applied correctly. But when making further adjustments, QuickAdd seems to get stuck on the old value again and I need another restart.
To Reproduce Steps to reproduce the behavior:
- Start Obsidian
- Go to QuickAdd settings, add a new Choice and enable it as a command
- Configure the "Template path" with a correct path to a template file
- Close Settings dialogs
- Ctrl+P → choose the new QuickAdd command
- ERROR: "Please specify a path"... so it still assumes that my Template path is empty (= the "old" value)
This is only one example with a newly configured Choice. Adjusting existing Choices gives me the same problem: QuickAdd reverts to using the old, previously configured value instead of the new one.
Expected behavior QuickAdd should save the last entered Template path value?
Desktop (please complete the following information):
- OS: Windows 10
- Version: Obsidian 0.14.6, QuickAdd 0.5.5
I am getting the same error "Please provide template path" ..., the same version of plugin + template EDIT: the error was in the macro I wasn't using when running my current command, after deleting the macro everything works fine
I debugged it even more, it seems that changing template without restarting Obsidian doesn't make template to change in QuickAdd, only after restarting the plugin/obsidian it loads the last version of the template/last path; But the problem was present when I was using Templater scripts, when I am just changing text file everything is ok
For example
<%*
let title = await tp.system.prompt("Title");
await tp.file.move("/Resources/Annotations/"+ title);
%>
---
Persisted and was keeping asking me twice for the file title, even if I changed the template to a second file containing
<%*
let title = tp.file.title ;
%>
After restart it works as expected
@danieltomasz: I don't fully understand your last comment - did you find a fix? Or did you confirm the buggy behavior, that restarts are always needed?
I am having this issue as well, the dialog to chose a folder/file doesn't even pop up, and after restarting running the command does nothing.
Edit:
Obsidian v0.14.6 On manjaro linux from the arch repos.
@wwwald
1 First issue: ERROR: "Please specify a path" - I solved it by manually editing the data file in the hidden plugin folder .obsidian/plugins/quickadd
and removing macro that hasn't specified a path
2. Later I found that sometimes the quick-add doesn't internally change the path to template even if I replace the path and point to another template (the old template containing templater commands was still loading, restart fixed this)
3. After restart I didn't thoroughly test but local changes in the same template are reflected, I didn't try changing template file
I have the ERROR: "Please specify a path"
issue as well. Running the QuickAdd: Run <macro name>
command fails, but the QuickAdd: Run QuickAdd
-> <macro name>
command works as expected.
It seems to happen when the option to add a command for a macro is toggled before the template path is defined. Works fine when the command option is toggled after.
Restarting Obsidian fixes it. Toggling the command option to disabled then enabled seems to fix it as well.
this is still an issue, so I'm here to add some more info: quickadd doesn't recognize any changes made until I restart the plugin (template path, file capture path, changes to macros, etc.) or cycle the command toggle.
As ghost stated, this seems to be some issue with the plugin re-caching only when the command toggle is messed with; if you have a functional template command for example and decide to change the template path, it will only reflect once you flip the command toggle on and off again.
Hi everyone! I have the same issue on windows, and nothing helps to solve it from the solutions above. Any hint would really appreciated, thanks
It works okay with File name format option turned off:
You should reactive the choice after you modify it.
It works okay with File name format option turned off:
Doesn't work regardless of where the setting is enabled or otherwise. My kludgey workaround is to prompt for a tag and then move the new file to the right folder.
In my case, the problems disappeared when I used a hyphen between the {{date}} and {{value}} statements
Hello everyone. I really appreciate you taking the time to report in on this issue.
This bug has been fixed as of 0.11: https://github.com/chhoumann/quickadd/releases/tag/0.11.0
Commands are now updated whenever you save. Thank you!