From 2953870db56d88d9ea39ccced75d342b40e5073f Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sun, 24 Dec 2023 09:40:01 +0800 Subject: [PATCH] :art: Creating a dailynote existed no longer expands the doc tree https://github.com/siyuan-note/siyuan/issues/9959 --- kernel/model/attribute_view.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index 9767722aa..d0d29880d 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -801,6 +801,9 @@ func updateAttributeViewColRelation(operation *Operation) (err error) { } isSameAv := srcAv.ID == destAv.ID + if isSameAv { + destAv = srcAv + } for _, keyValues := range srcAv.KeyValues { if keyValues.Key.ID == operation.KeyID { @@ -857,6 +860,13 @@ func updateAttributeViewColRelation(operation *Operation) (err error) { Relation: &av.Relation{AvID: operation.AvID, IsTwoWay: operation.IsTwoWay, BackKeyID: operation.KeyID}, }, }) + + for _, v := range destAv.Views { + switch v.LayoutType { + case av.LayoutTypeTable: + v.Table.Columns = append(v.Table.Columns, &av.ViewTableColumn{ID: operation.KeyID}) + } + } } err = av.SaveAttributeView(srcAv)