1
0
Эх сурвалжийг харах

fix: importer failing hard on page ref when

page name has same name as a task. Importer failed because of invalid
refs coming from gp-block/with-page-refs-and-tags which were caused
by get-first-page-by-title returning blocks. In 4f368d5c791d70fb2ae3ff59bc046fb98561d54f,
get-first-page-by-title started returning blocks instead of only pages
so this was undone.  Fixes part of logseq/db-test#191
Gabriel Horner 9 сар өмнө
parent
commit
0cffd64d44

+ 1 - 1
deps/db/src/logseq/db/sqlite/common_db.cljs

@@ -29,7 +29,7 @@
   (->> (d/datoms db :avet :block/title page-name)
        (filter (fn [d]
                  (let [e (d/entity db (:e d))]
-                   (or (entity-util/page? e) (:block/tags e)))))
+                   (entity-util/page? e))))
        (map :e)
        sort
        first))

+ 1 - 1
deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs

@@ -177,7 +177,7 @@
 
       ;; Counts
       ;; Includes journals as property values e.g. :logseq.task/deadline
-      (is (= 24 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Journal]] @conn))))
+      (is (= 25 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Journal]] @conn))))
 
       (is (= 4 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Task]] @conn))))
       (is (= 3 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Query]] @conn))))

+ 1 - 0
deps/graph-parser/test/resources/exporter-test-graph/journals/2025_01_10.md

@@ -0,0 +1 @@
+- A page ref with same as a block (task in this case) shouldn't fail [[do X]]