Skip to content

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

:bug: Custom sorting not maintained after importing .sy.zip Fix https://github.com/siyuan-note/siyuan/issues/8283

Liang Ding4125a61fc651
diff --git a/kernel/model/import.go b/kernel/model/import.go
index e5d48d6ed7..185b1accbc 100644
--- a/kernel/model/import.go
+++ b/kernel/model/import.go
@@ -243,13 +243,16 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
sortData, sortErr = gulu.JSON.MarshalJSON(fullSortIDs)
if nil != sortErr {
- logging.LogErrorf("marshal temp full sort conf failed: %s", sortErr)
+ logging.LogErrorf("marshal box full sort conf failed: %s", sortErr)
} else {
- sortErr = filelock.WriteFile(sortPath, sortData)
+ sortErr = filelock.WriteFile(boxSortPath, sortData)
if nil != sortErr {
- logging.LogErrorf("write temp full sort conf failed: %s", sortErr)
+ logging.LogErrorf("write box full sort conf failed: %s", sortErr)
}
}
+ if removeErr := os.RemoveAll(sortPath); nil != removeErr {
+ logging.LogErrorf("remove temp sort conf failed: %s", removeErr)
+ }
}
// 重命名文件路径