Skip to content

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

:art: Improve database field default filling https://github.com/siyuan-note/siyuan/issues/11966

Danielfc4938829f8c
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index 1dd7e9a53f..bb8f287686 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -81,6 +81,11 @@ func GetAttrViewAddingBlockDefaultValues(avID, viewID, groupID, previousBlockID,
func getAttrViewAddingBlockDefaultValues(attrView *av.AttributeView, view, groupView *av.View, previousBlockID, addingBlockID string) (ret map[string]*av.Value) {
ret = map[string]*av.Value{}
+ if 1 > len(view.Filters) && nil == view.Group {
+ // 没有过滤条件也没有分组条件时忽略
+ return
+ }
+
nearItem := getNearItem(attrView, view, groupView, previousBlockID)
filterKeyIDs := map[string]bool{}
for _, f := range view.Filters {