From 46f81b93edf05fa0ee616d39839efe3a01d727f8 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sat, 2 Aug 2025 18:17:54 +0800 Subject: [PATCH] :art: Improve database field default filling https://github.com/siyuan-note/siyuan/issues/11966 --- kernel/av/filter.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/kernel/av/filter.go b/kernel/av/filter.go index 7cba746cb..708e848fb 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 {