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

Daniel46f81b93edf0
diff --git a/kernel/av/filter.go b/kernel/av/filter.go
index 7cba746cbe..708e848fb3 100644
--- a/kernel/av/filter.go
+++ b/kernel/av/filter.go
@@ -875,21 +875,21 @@ func (filter *ViewFilter) GetAffectValue(key *Key, defaultVal *Value, addingBloc
case KeyTypeBlock:
switch filter.Operator {
case FilterOperatorIsEqual:
- ret.Block = &ValueBlock{ID: filter.Value.Block.ID, Content: filter.Value.Block.Content}
+ ret.Block = &ValueBlock{ID: addingBlockID, Content: filter.Value.Block.Content, Created: ret.CreatedAt, Updated: ret.UpdatedAt}
case FilterOperatorIsNotEqual:
- ret.Block = &ValueBlock{ID: filter.Value.Block.ID, Content: ""}
+ ret.Block = &ValueBlock{ID: addingBlockID, Content: "", Created: ret.CreatedAt, Updated: ret.UpdatedAt}
case FilterOperatorContains:
- ret.Block = &ValueBlock{ID: filter.Value.Block.ID, Content: filter.Value.Block.Content}
+ ret.Block = &ValueBlock{ID: addingBlockID, Content: filter.Value.Block.Content, Created: ret.CreatedAt, Updated: ret.UpdatedAt}
case FilterOperatorDoesNotContain:
- ret.Block = &ValueBlock{ID: filter.Value.Block.ID, Content: ""}
+ ret.Block = &ValueBlock{ID: addingBlockID, Content: "", Created: ret.CreatedAt, Updated: ret.UpdatedAt}
case FilterOperatorStartsWith:
- ret.Block = &ValueBlock{ID: filter.Value.Block.ID, Content: filter.Value.Block.Content}
+ ret.Block = &ValueBlock{ID: addingBlockID, Content: filter.Value.Block.Content, Created: ret.CreatedAt, Updated: ret.UpdatedAt}
case FilterOperatorEndsWith:
- ret.Block = &ValueBlock{ID: filter.Value.Block.ID, Content: filter.Value.Block.Content}
+ ret.Block = &ValueBlock{ID: addingBlockID, Content: filter.Value.Block.Content, Created: ret.CreatedAt, Updated: ret.UpdatedAt}
case FilterOperatorIsEmpty:
- ret.Block = &ValueBlock{ID: filter.Value.Block.ID, Content: ""}
+ ret.Block = &ValueBlock{ID: addingBlockID, Content: "", Created: ret.CreatedAt, Updated: ret.UpdatedAt}
case FilterOperatorIsNotEmpty:
- ret.Block = &ValueBlock{ID: filter.Value.Block.ID, Content: ""}
+ ret.Block = &ValueBlock{ID: addingBlockID, Content: "", Created: ret.CreatedAt, Updated: ret.UpdatedAt}
}
case KeyTypeText:
switch filter.Operator {