Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Fix path retrieval in CreateWithMarkdown function (#16268)

Jeffrey Chen15674d67f7d3
diff --git a/kernel/model/file.go b/kernel/model/file.go
index 42c7c87cbc..4685ff3ce8 100644
--- a/kernel/model/file.go
+++ b/kernel/model/file.go
@@ -1073,7 +1073,12 @@ func CreateWithMarkdown(tags, boxID, hPath, md, parentID, id string, withMath bo
SetBlockAttrs(retID, nameValues)
FlushTxQueue()
- box.addMinSort(path.Dir(hPath), retID)
+ docPath, _, err := GetPathByID(retID)
+ if err != nil {
+ logging.LogWarnf("get path by id [%s] failed: %s", retID, err)
+ return
+ }
+ box.addMinSort(path.Dir(docPath), retID)
return
}