🐛 Database rollup calculation misses null values https://github.com/siyuan-note/siyuan/issues/10843

This commit is contained in:
Daniel 2024-04-03 09:37:42 +08:00
parent e7204ac10f
commit 2a3d236d8e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 34 additions and 4 deletions

View file

@ -523,6 +523,22 @@ func (av *AttributeView) GetCurrentView(viewID string) (ret *View, err error) {
return
}
func (av *AttributeView) ExistBlock(blockID string) bool {
for _, kv := range av.KeyValues {
if KeyTypeBlock != kv.Key.Type {
continue
}
for _, v := range kv.Values {
if v.BlockID == blockID {
return true
}
}
return false
}
return false
}
func (av *AttributeView) GetValue(keyID, blockID string) (ret *Value) {
for _, kv := range av.KeyValues {
if kv.Key.ID == keyID {