fix: can't create new page or rename page if same page with

different parent exists.

fixes https://github.com/logseq/db-test/issues/272
This commit is contained in:
Tienson Qin
2025-05-04 16:52:59 +08:00
parent 230a512ccf
commit 5ce4935c51
2 changed files with 25 additions and 4 deletions

View File

@@ -112,9 +112,17 @@
(take (get-group-limit group) items))))
node-exists? (let [blocks-result (keep :source-block (get-in results [:nodes :items]))]
(when-not (string/blank? input)
(or (some-> (text/get-namespace-last-part input)
string/trim
db/get-page)
(or (let [page (some-> (text/get-namespace-last-part input)
string/trim
db/get-page)
parent-title (:block/title (:logseq.property/parent page))
namespace? (string/includes? input "/")]
(and page
(or (not namespace?)
(and
parent-title
(= (util/page-name-sanity-lc parent-title)
(util/page-name-sanity-lc (nth (reverse (string/split input "/")) 1)))))))
(some (fn [block]
(and
(:block/tags block)