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

[BUG] Map and the Value of the Variable currentTiddler Outside the Filter run in File System Paths #8520

Open
kookma opened this issue Aug 16, 2024 · 4 comments

Comments

@kookma
Copy link
Contributor

kookma commented Aug 16, 2024

Describe the bug

There is an interesting discussion on Talk: https://talk.tiddlywiki.org/t/file-system-path-store-tiddlers-come-from-a-tiddler-field/10419. The question is how to write a filter for $:/config/FileSystemPaths to store tiddlers listed in diary field of other tiddlers under diary/ sub folder.

The working filter is reported to be: (I tested and it works as said)

[has[title]] :filter[all[tiddlers]contains:diary<currentTiddler>] :and[addprefix[diary/]]

For curiosity, I changed the filter as below to add the tiddler lists the target tiddler in its diary field to the path. So, I used :map:

[has[title]listed[diary]] :map[get[title]addsuffix[/diary/]addsuffix<..currentTiddler>]

and I noticed the <..currentTiddler>. as tiddlers are stored as .tid with no title.

Expected behavior

The filter [has[title]listed[diary]] :map[get[title]addsuffix[/diary/]addsuffix<..currentTiddler>] in $:/config/FileSystemPaths should work.

The <..currentTiddler> should return the value of the variable currentTiddler outside the filter run.

TiddlyWiki Configuration

  • TiddlyWiki 5.3.6-pre
  • Node.Js version v18.17.1
  • Windows 11
  • Edge 128
@kookma
Copy link
Contributor Author

kookma commented Aug 16, 2024

I have created a test set for quick evaluation. The pack contains below tiddlers

Test Path
$:/config/FileSystemPaths
One
Two
Thirty Four
16th August 2024

The test path contains a method by @saqimtiaz to check the validity of filters in $:/config/FileSystemPaths
it works, but the file saved with no title. Seems something goes strange in FS and does not respect the <..currentTiddler>.

The 16th August 2024 has diary field with One Two [[Thirty Four]] as value.

test-set.zip

@saqimtiaz
Copy link
Member

[has[title]listed[diary]] :map[get[title]addsuffix[/diary/]addsuffix<..currentTiddler>]

@kookma can you please confirm the exact file path at which the tiddler is stored with this filter? Does it respect the diary suffix?

@saqimtiaz
Copy link
Member

The problem here is that there is no value of the variable currentTiddler in the filter expression of a file system path unless set by a filter run within it. See #8544

@kookma
Copy link
Contributor Author

kookma commented Aug 24, 2024

Thank you for clarification Saq. I am closely following the progress of issue #8544.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants