From 73869d7f69233ee6d48cbda74ea77abd54555c96 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Tue, 23 Sep 2025 20:34:36 +0800 Subject: [PATCH 1/4] :bug: https://github.com/siyuan-note/siyuan/issues/15915 Signed-off-by: Daniel <845765@qq.com> --- kernel/av/filter.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/av/filter.go b/kernel/av/filter.go index 3213c1ee7..d57293c68 100644 --- a/kernel/av/filter.go +++ b/kernel/av/filter.go @@ -541,6 +541,10 @@ func (value *Value) filter(other *Value, relativeDate, relativeDate2 *RelativeDa return !value.Checkbox.Checked } } + case KeyTypeRelation: + if nil != value.Relation && nil != other && nil != other.Relation { + return filterTextContent(operator, value.Relation.Contents[0].Block.Content, other.Relation.Contents[0].Block.Content) + } } return false } From 6d98e3b18ad8a749d6d3e661c9c294ad4cfc1d25 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Tue, 23 Sep 2025 20:35:14 +0800 Subject: [PATCH 2/4] :bug: https://github.com/siyuan-note/siyuan/issues/15915 Signed-off-by: Daniel <845765@qq.com> --- kernel/av/filter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/av/filter.go b/kernel/av/filter.go index d57293c68..b7e33a624 100644 --- a/kernel/av/filter.go +++ b/kernel/av/filter.go @@ -542,7 +542,7 @@ func (value *Value) filter(other *Value, relativeDate, relativeDate2 *RelativeDa } } case KeyTypeRelation: - if nil != value.Relation && nil != other && nil != other.Relation { + if nil != value.Relation && 0 < len(value.Relation.Contents) && nil != other && nil != other.Relation && 0 < len(other.Relation.Contents) { return filterTextContent(operator, value.Relation.Contents[0].Block.Content, other.Relation.Contents[0].Block.Content) } } From e8378c62612060fb33607c6f6341cda843cfa5c5 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Tue, 23 Sep 2025 20:35:57 +0800 Subject: [PATCH 3/4] :bug: https://github.com/siyuan-note/siyuan/issues/15915 Signed-off-by: Daniel <845765@qq.com> --- kernel/av/filter.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/av/filter.go b/kernel/av/filter.go index b7e33a624..e4066e308 100644 --- a/kernel/av/filter.go +++ b/kernel/av/filter.go @@ -542,7 +542,8 @@ func (value *Value) filter(other *Value, relativeDate, relativeDate2 *RelativeDa } } case KeyTypeRelation: - if nil != value.Relation && 0 < len(value.Relation.Contents) && nil != other && nil != other.Relation && 0 < len(other.Relation.Contents) { + if nil != value.Relation && 0 < len(value.Relation.Contents) && nil != value.Relation.Contents[0].Block && + nil != other && nil != other.Relation && 0 < len(other.Relation.Contents) && nil != other.Relation.Contents[0].Block { return filterTextContent(operator, value.Relation.Contents[0].Block.Content, other.Relation.Contents[0].Block.Content) } } From 16a8e4926c7ff12421b673e8075e506effbc98f4 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Tue, 23 Sep 2025 20:43:32 +0800 Subject: [PATCH 4/4] :bug: https://github.com/siyuan-note/siyuan/issues/15915 Signed-off-by: Daniel <845765@qq.com> --- kernel/av/filter.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/av/filter.go b/kernel/av/filter.go index e4066e308..9acb813ce 100644 --- a/kernel/av/filter.go +++ b/kernel/av/filter.go @@ -541,10 +541,11 @@ func (value *Value) filter(other *Value, relativeDate, relativeDate2 *RelativeDa return !value.Checkbox.Checked } } - case KeyTypeRelation: + case KeyTypeRelation: // 过滤汇总字段,并且汇总目标是关联字段时才会进入该分支 if nil != value.Relation && 0 < len(value.Relation.Contents) && nil != value.Relation.Contents[0].Block && - nil != other && nil != other.Relation && 0 < len(other.Relation.Contents) && nil != other.Relation.Contents[0].Block { - return filterTextContent(operator, value.Relation.Contents[0].Block.Content, other.Relation.Contents[0].Block.Content) + nil != other && nil != other.Relation && 0 < len(other.Relation.BlockIDs) { + filterValue := &Value{Type: KeyTypeBlock, Block: &ValueBlock{Content: other.Relation.BlockIDs[0]}} + return filterTextContent(operator, value.Relation.Contents[0].Block.Content, filterValue.Block.Content) } } return false