Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Add multi-select type column to Attribute View https://github.com/siyuan-note/siyuan/issues/8695

Daniel36d0c558e31d
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index 01b1e18dba..eb15697078 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -364,10 +364,10 @@ func updateAttributeViewColumnOption(operation *Operation) (err error) {
continue
}
- if nil != cell.Value.Select {
- if oldName == cell.Value.Select.Content {
- cell.Value.Select.Content = newName
- cell.Value.Select.Color = newColor
+ if nil != cell.Value.MSelect && 0 < len(cell.Value.MSelect) && nil != cell.Value.MSelect[0] {
+ if oldName == cell.Value.MSelect[0].Content {
+ cell.Value.MSelect[0].Content = newName
+ cell.Value.MSelect[0].Color = newColor
break
}
} else if nil != cell.Value.MSelect {
@@ -433,8 +433,8 @@ func removeAttributeViewColumnOption(operation *Operation) (err error) {
}
if nil != cell.Value {
- if nil != cell.Value.Select {
- if optName == cell.Value.Select.Content {
+ if nil != cell.Value.MSelect && 0 < len(cell.Value.MSelect) && nil != cell.Value.MSelect[0] {
+ if optName == cell.Value.MSelect[0].Content {
cell.Value = nil
break
}