Skip to content

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

:art: Adding row overwriting data after enabling sort in database Fix https://github.com/siyuan-note/siyuan/issues/9517

Daniel71dd27c62a41
diff --git a/kernel/av/table.go b/kernel/av/table.go
index 0342b50ca6..0c0963c73e 100644
--- a/kernel/av/table.go
+++ b/kernel/av/table.go
@@ -610,6 +610,11 @@ func (table *Table) SortRows() {
}
sort.Slice(table.Rows, func(i, j int) bool {
+ block := table.Rows[i].GetBlockValue()
+ if !block.IsInitialized && nil != block.Block && "" == block.Block.Content && block.IsDetached {
+ return false
+ }
+
for _, colIndexSort := range colIndexSorts {
result := table.Rows[i].Cells[colIndexSort.Index].Value.Compare(table.Rows[j].Cells[colIndexSort.Index].Value)
if 0 == result {