Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2025-08-11 23:13:04 +08:00
commit fec603487b

View file

@ -4229,6 +4229,19 @@ func updateAttributeViewValue(tx *Transaction, attrView *av.AttributeView, keyID
}
} else if av.KeyTypeSelect == val.Type || av.KeyTypeMSelect == val.Type {
if nil != key && 0 < len(val.MSelect) {
var tmp []*av.ValueSelect
// 移除空选项 https://github.com/siyuan-note/siyuan/issues/15533
for _, v := range val.MSelect {
if "" != v.Content {
tmp = append(tmp, v)
}
}
val.MSelect = tmp
if 1 > len(val.MSelect) {
return
}
// The selection options are inconsistent after pasting data into the database https://github.com/siyuan-note/siyuan/issues/11409
for _, valOpt := range val.MSelect {
if opt := key.GetOption(valOpt.Content); nil == opt {
@ -4551,6 +4564,18 @@ func updateAttributeViewColumnOptions(operation *Operation) (err error) {
return
}
// 移除空选项 https://github.com/siyuan-note/siyuan/issues/15533
var tmp []*av.SelectOption
for _, opt := range options {
if "" != opt.Name {
tmp = append(tmp, opt)
}
}
options = tmp
if 1 > len(options) {
return
}
for _, keyValues := range attrView.KeyValues {
if keyValues.Key.ID == operation.ID {
keyValues.Key.Options = options