mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 08:30:42 +02:00
🐛 Incorrect results for database rollup field filtering https://github.com/siyuan-note/siyuan/issues/15608
This commit is contained in:
parent
fa7ec5ab95
commit
312be8a019
4 changed files with 34 additions and 61 deletions
|
@ -1534,28 +1534,7 @@ func GetBlockAttributeViewKeys(nodeID string) (ret []*BlockAttributeViewKeys) {
|
|||
}
|
||||
}
|
||||
|
||||
kv.Values[0].Rollup.Contents = nil
|
||||
for _, bID := range relVal.Relation.BlockIDs {
|
||||
destVal := destAv.GetValue(kv.Key.Rollup.KeyID, bID)
|
||||
if nil != furtherCollection && av.KeyTypeTemplate == destKey.Type {
|
||||
destVal = furtherCollection.GetValue(bID, destKey.ID)
|
||||
}
|
||||
|
||||
if nil == destVal {
|
||||
if destAv.ExistItem(bID) { // 数据库中存在项目但是字段值不存在是数据未初始化,这里补一个默认值
|
||||
destVal = av.GetAttributeViewDefaultValue(ast.NewNodeID(), kv.Key.Rollup.KeyID, bID, destKey.Type)
|
||||
}
|
||||
if nil == destVal {
|
||||
continue
|
||||
}
|
||||
}
|
||||
if av.KeyTypeNumber == destKey.Type {
|
||||
destVal.Number.Format = destKey.NumberFormat
|
||||
destVal.Number.FormatNumber()
|
||||
}
|
||||
|
||||
kv.Values[0].Rollup.Contents = append(kv.Values[0].Rollup.Contents, destVal.Clone())
|
||||
}
|
||||
kv.Values[0].Rollup.Contents = av.GetRollupContents(destAv, destKey, relVal.Relation.BlockIDs, furtherCollection)
|
||||
kv.Values[0].Rollup.RenderContents(kv.Key.Rollup.Calc, destKey)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue