Daniel 2025-08-25 10:58:45 +08:00
parent d0f350d215
commit 8895613f8b
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 8 additions and 8 deletions

View file

@ -351,7 +351,7 @@ func addAttributeViewBlocks(c *gin.Context) {
ignoreDefaultFill = arg["ignoreDefaultFill"].(bool)
}
err := model.AddAttributeViewBlock(nil, srcs, avID, blockID, groupID, previousID, ignoreDefaultFill, nil)
err := model.AddAttributeViewBlock(nil, srcs, avID, blockID, groupID, previousID, ignoreDefaultFill, map[string]interface{}{})
if err != nil {
ret.Code = -1
ret.Msg = err.Error()

View file

@ -2958,6 +2958,10 @@ func setAttributeViewColumnCalc(operation *Operation) (err error) {
}
func (tx *Transaction) doInsertAttrViewBlock(operation *Operation) (ret *TxErr) {
if nil == operation.Context {
operation.Context = map[string]interface{}{}
}
err := AddAttributeViewBlock(tx, operation.Srcs, operation.AvID, operation.BlockID, operation.GroupID, operation.PreviousID, operation.IgnoreDefaultFill, operation.Context)
if err != nil {
return &TxErr{code: TxErrHandleAttributeView, id: operation.AvID, msg: err.Error()}
@ -3008,10 +3012,6 @@ func AddAttributeViewBlock(tx *Transaction, srcs []map[string]interface{}, avID,
}
func addAttributeViewBlock(now int64, avID, dbBlockID, groupID, previousItemID, addingItemID, addingBoundBlockID, addingBlockContent string, isDetached, ignoreDefaultFill bool, tree *parse.Tree, tx *Transaction, context map[string]interface{}) (err error) {
if nil == context {
context = map[string]any{}
}
var node *ast.Node
if !isDetached {
node = treenode.GetNodeInTree(tree, addingBoundBlockID)

View file

@ -991,7 +991,7 @@ func DuplicateDoc(tree *parse.Tree) {
AddAttributeViewBlock(nil, []map[string]interface{}{{
"id": n.ID,
"isDetached": false,
}}, avID, "", "", "", false, nil)
}}, avID, "", "", "", false, map[string]interface{}{})
ReloadAttrView(avID)
}
return ast.WalkContinue

View file

@ -1099,7 +1099,7 @@ func (tx *Transaction) doLargeInsert(previousID string) (ret *TxErr) {
AddAttributeViewBlock(tx, []map[string]interface{}{{
"id": insertedNode.ID,
"isDetached": false,
}}, avID, "", "", previousID, false, nil)
}}, avID, "", "", previousID, false, map[string]interface{}{})
ReloadAttrView(avID)
}
@ -1284,7 +1284,7 @@ func (tx *Transaction) doInsert(operation *Operation) (ret *TxErr) {
AddAttributeViewBlock(tx, []map[string]interface{}{{
"id": insertedNode.ID,
"isDetached": false,
}}, avID, "", "", previousID, false, nil)
}}, avID, "", "", previousID, false, map[string]interface{}{})
ReloadAttrView(avID)
}