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 https://github.com/siyuan-note/siyuan/issues/9599

Danielbbbdda7ef0cc
diff --git a/kernel/av/table.go b/kernel/av/table.go
index 77f0cdf78a..9efce576e4 100644
--- a/kernel/av/table.go
+++ b/kernel/av/table.go
@@ -626,11 +626,6 @@ 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 {
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index 7de99c1eaa..f9fadfb9d3 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -712,7 +712,10 @@ func addAttributeViewBlock(blockID string, operation *Operation, tree *parse.Tre
return
}
} else {
- blockID = ast.NewNodeID()
+ if "" == blockID {
+ blockID = ast.NewNodeID()
+ logging.LogWarnf("detached block id is empty, generate a new one [%s]", blockID)
+ }
}
attrView, err := av.ParseAttributeView(operation.AvID)