Skip to content

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

:bug: 导入 `.sy.zip` 后丢失自定义排序 Fix https://github.com/siyuan-note/siyuan/issues/6611

Liang Ding171f7cf7777a
diff --git a/kernel/model/import.go b/kernel/model/import.go
index 279d397018..e7fbc73a1a 100644
--- a/kernel/model/import.go
+++ b/kernel/model/import.go
@@ -190,9 +190,9 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
logging.LogErrorf("unmarshal sort conf failed: %s", sortErr)
}
- sortPath = filepath.Join(util.DataDir, boxID, ".siyuan", "sort.json")
- if gulu.File.IsExist(sortPath) {
- sortData, sortErr = filelock.ReadFile(sortPath)
+ boxSortPath := filepath.Join(util.DataDir, boxID, ".siyuan", "sort.json")
+ if gulu.File.IsExist(boxSortPath) {
+ sortData, sortErr = filelock.ReadFile(boxSortPath)
if nil != sortErr {
logging.LogErrorf("read box sort conf failed: %s", sortErr)
}
@@ -210,11 +210,11 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
sortData, sortErr = gulu.JSON.MarshalJSON(fullSortIDs)
if nil != sortErr {
- logging.LogErrorf("marshal box sort conf failed: %s", sortErr)
+ logging.LogErrorf("marshal temp full sort conf failed: %s", sortErr)
} else {
sortErr = filelock.WriteFile(sortPath, sortData)
if nil != sortErr {
- logging.LogErrorf("write box sort conf failed: %s", sortErr)
+ logging.LogErrorf("write temp full sort conf failed: %s", sortErr)
}
}
}