shabegom / buttons

Buttons in Obsidian
The Unlicense
453 stars 47 forks source link

tp.file.title is undefined when using button to append Templater template #210

Closed DanBiscotti closed 4 months ago

DanBiscotti commented 4 months ago

Hi there, I'm using Obsidian v1.5.3 on Windows (also replicated on Linux). Buttons v0.5.0 Templater v2.1.3

I have a template called "Hello Template":

Hello <% tp.file.title %>

And I also have a file called "World" with a button inside:

```button
name Print hello world
type append template
action Hello Template
templater true


I was expecting it would be able to add "Hello World" to the bottom, but instead I am getting "Hello undefined"
![image](https://github.com/shabegom/buttons/assets/17572990/65f7d4bd-f2b8-415a-9aaa-b6876a93eeee)

Am I missing something or is this a potential bug? If so I'm surprised it hasn't been raised before (that I can see)
Thanks
rudyolph commented 4 months ago

Having the same issue! This started last week. Both Buttons and Templater had releases last week. However I tried reverting to the previous version of Templater and the issue is still there. Going to try and revert to the previous of Buttons and see if it still occurs there too.

rudyolph commented 4 months ago

Previous version of Buttons is working as expected so I believe this is a bug with the latest version.

shabegom commented 4 months ago

Yeah it's an issue with the new Templater processing. I need to revert that change. Will try to get to it tomorrow.

shabegom commented 4 months ago

This should now be fixed. It was an interesting problem to solve. Three of the tp.file commands are called dynamic_functions and Buttons wasn't handling them properly. Should work much better now. LMK if you run into any issues.