dsebastien / obsidian-dataview-serializer

Obsidian plugin that gives you the power of Dataview, but generates Markdown, making it compatible with Obsidian Publish, and making the links appear on the Graph.
https://developassion.gitbook.io/obsidian-dataview-serializer
MIT License
57 stars 6 forks source link

References to "this" do not appear to work #6

Closed tijmenvdk closed 4 months ago

tijmenvdk commented 4 months ago

The following query does not give any result: <!-- QueryToSerialize: LIST WITHOUT ID trainerFor from #talent where file.path = this.file.path -->

whereas the dataview query does: LIST WITHOUT ID trainerFor from #talent where file.path=this.file.path

Replacing the "this" with an explicit path does work: <!-- QueryToSerialize: LIST WITHOUT ID trainerFor from #talent where file.path="Talent insights/Talent/geo/name.md" -->

The "this" keyword is currently part of the template, would prefer to avoid having to update 200 files.

tijmenvdk commented 4 months ago

The same seems to apply to queries that use [[]] in the FROM statement: no results, but [[current file]] does work.

dsebastien commented 4 months ago

Indeed, I noticed that too. I think I know why. I did not provide the origin file when calling the Dataview queryMarkdown function: https://github.com/blacksmithgu/obsidian-dataview/blob/d05d6d6d5033c5b115420ac15532e1604bda39ef/src/api/inline-api.ts#L151

I guess doing so will fix the issue. I'll look at it this week

dsebastien commented 4 months ago

I've pushed version 1.1.4 to try and fix this. I now set the origin file correctly.