This commit is contained in:
Daniel 2024-04-15 18:00:04 +08:00
parent 58c98ce697
commit 97f8d6c013
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -1301,18 +1301,20 @@ func unbindAttributeViewBlock(operation *Operation, tx *Transaction) (err error)
return
}
keyValues := attrView.GetBlockKeyValues()
for _, value := range keyValues.Values {
if value.BlockID != operation.ID {
continue
}
for _, keyValues := range attrView.KeyValues {
for _, value := range keyValues.Values {
if value.BlockID != operation.ID {
continue
}
unbindBlockAv(tx, operation.AvID, value.BlockID)
value.BlockID = operation.NextID
if nil != value.Block {
value.Block.ID = operation.NextID
if av.KeyTypeBlock == value.Type {
unbindBlockAv(tx, operation.AvID, value.BlockID)
}
value.BlockID = operation.NextID
if nil != value.Block {
value.Block.ID = operation.NextID
}
}
break
}
replacedRowID := false
@ -2956,25 +2958,27 @@ func replaceAttributeViewBlock(operation *Operation, tx *Transaction) (err error
for _, keyValues := range attrView.KeyValues {
for _, value := range keyValues.Values {
if value.BlockID == operation.PreviousID {
if value.BlockID != operation.NextID {
// 换绑
unbindBlockAv(tx, operation.AvID, value.BlockID)
}
if value.BlockID != operation.PreviousID {
continue
}
value.BlockID = operation.NextID
if nil != value.Block {
value.Block.ID = operation.NextID
value.IsDetached = operation.IsDetached
if !operation.IsDetached {
value.Block.Content = getNodeRefText(node)
}
}
if av.KeyTypeBlock == value.Type && value.BlockID != operation.NextID {
// 换绑
unbindBlockAv(tx, operation.AvID, value.BlockID)
}
value.BlockID = operation.NextID
if av.KeyTypeBlock == value.Type && nil != value.Block {
value.Block.ID = operation.NextID
value.IsDetached = operation.IsDetached
if !operation.IsDetached {
bindBlockAv(tx, operation.AvID, operation.NextID)
value.Block.Content = getNodeRefText(node)
}
}
if av.KeyTypeBlock == value.Type && !operation.IsDetached {
bindBlockAv(tx, operation.AvID, operation.NextID)
}
}
}