sawhney17 / logseq-automatic-linker

MIT License
94 stars 17 forks source link

Issue with advanced queries auto linking. #70

Closed knutztar closed 7 months ago

knutztar commented 10 months ago

Automatic Linker Version: 1.5.5 Logseq version: 0.9.20

I have a strange situation where when pressing enter on a block with an advanced query or that has a child block with a query, Automatic Linker changes my query. Disabling Automatic Linker stops this behavior.

My query:

#+BEGIN_QUERY
{:title ["📆 Opgaver næste 7 dage"] 
   :query      [:find (pull ?b [*])
                :in $ ?start ?next
                :where
                [?b :block/marker ?marker]
                [?b :block/ref-pages ?rp]
                (or [?b :block/scheduled ?d]
                    [?b :block/deadline ?d]
                )
                [(contains? #{"NOW" "LATER" "DOING" "TODO"} ?marker)]
                [(>= ?d ?start)]
                [(<= ?d ?next)]
               ]
    ;Sorteret efter deadline, derefter scheduled
    :result-transform (fn [result] (sort-by (juxt (fn [d] (get d :block/deadline) ) (fn [d] (get d :block/scheduled) ) ) result))
    :inputs [:today :7d-after]
    :collapsed? false}
]}

Automatic Linker changes the line [(contains? #{"NOW" "LATER" "DOING" "TODO"} ?marker)] to [(contains? #[[15-11-2023]] ?marker)]. It changes #{"NOW" "LATER" "DOING" "TODO"} to todays date. This happens in Contents in the right sidebar. It also happens in pages but is not always reproducible.

Let me know if you need anything else.