From be67ffa288afe7066f2e6b6db6702b6db15c807f Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 3 Apr 2024 21:17:54 +0800 Subject: [PATCH] :art: Auto verify the database name when clicking the block superscript icon https://github.com/siyuan-note/siyuan/issues/10861 --- kernel/model/attribute_view.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index ffd62d553..e99d1bdcb 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -289,6 +289,13 @@ func GetBlockAttributeViewKeys(blockID string) (ret []*BlockAttributeViewKeys) { return } + if !attrView.ExistBlock(blockID) { + // 比如剪切后粘贴,块 ID 会变,但是属性还在块上,这里做一次数据订正 + // Auto verify the database name when clicking the block superscript icon https://github.com/siyuan-note/siyuan/issues/10861 + unbindBlockAv(nil, avID, blockID) + return + } + var keyValues []*av.KeyValues for _, kv := range attrView.KeyValues { kValues := &av.KeyValues{Key: kv.Key}