mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
🐛 Primary key value unexpectedly updated when database adds row https://github.com/siyuan-note/siyuan/issues/11018
This commit is contained in:
parent
20fb74c8d7
commit
bc8b295733
2 changed files with 7 additions and 7 deletions
|
|
@ -2971,7 +2971,7 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string,
|
|||
}
|
||||
|
||||
for _, value := range keyValues.Values {
|
||||
if cellID == value.ID {
|
||||
if cellID == value.ID || rowID == value.BlockID {
|
||||
val = value
|
||||
val.Type = keyValues.Key.Type
|
||||
break
|
||||
|
|
@ -3003,12 +3003,6 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string,
|
|||
return
|
||||
}
|
||||
|
||||
if "" == val.ID {
|
||||
// 有时前端会误调用该接口(比如创建完快速切换),这里判断一下,避免误更新刚刚创建的值
|
||||
// Primary key value unexpectedly updated when database adds row https://github.com/siyuan-note/siyuan/issues/11018
|
||||
return
|
||||
}
|
||||
|
||||
if av.KeyTypeNumber == val.Type {
|
||||
if nil != val.Number && !val.Number.IsNotEmpty {
|
||||
val.Number.Content = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue