An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Improve av https://github.com/siyuan-note/siyuan/issues/15527
Daniel93fdc69becfa
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.goindex 8de8bd6957..139bfc51d3 100644--- a/kernel/model/attribute_view.go+++ b/kernel/model/attribute_view.go@@ -1493,12 +1493,14 @@ func GetBlockAttributeViewKeys(nodeID string) (ret []*BlockAttributeViewKeys) {switch kv.Key.Type {case av.KeyTypeTemplate:if 0 < len(kv.Values) {- ial := map[string]string{}+ var ial map[string]stringblock := av.GetKeyBlockValue(keyValues)if nil != block && !block.IsDetached {ial = sql.GetBlockAttrs(block.BlockID)}-+ if nil == ial {+ ial = map[string]string{}+ }if nil == kv.Values[0].Template {kv.Values[0] = av.GetAttributeViewDefaultValue(kv.Values[0].ID, kv.Key.ID, nodeID, kv.Key.Type)}diff --git a/kernel/sql/av.go b/kernel/sql/av.goindex 6a383e4d4e..26af3224bd 100644--- a/kernel/sql/av.go+++ b/kernel/sql/av.go@@ -488,11 +488,14 @@ func fillAttributeViewTemplateValues(attrView *av.AttributeView, collection av.Cswitch value.Type {case av.KeyTypeTemplate: // 渲染模板字段keyValues := items[itemID]- ial := map[string]string{}+ var ial map[string]stringblockVal := item.GetBlockValue()if nil != blockVal {ial = ials[blockVal.Block.ID]}+ if nil == ial {+ ial = map[string]string{}+ }content, renderErr := RenderTemplateField(ial, keyValues, value.Template.Content)value.Template.Content = contentif nil != renderErr {