diff --git a/kernel/api/av.go b/kernel/api/av.go index 4f3407b09..58fe3c2c6 100644 --- a/kernel/api/av.go +++ b/kernel/api/av.go @@ -127,8 +127,12 @@ func addAttributeViewValues(c *gin.Context) { if nil != arg["ignoreFillFilter"] { ignoreFillFilter = arg["ignoreFillFilter"].(bool) } + var content string + if nil != arg["content"] { + content = arg["content"].(string) + } - err := model.AddAttributeViewBlock(nil, srcIDs, avID, blockID, previousID, isDetached, ignoreFillFilter) + err := model.AddAttributeViewBlock(nil, srcIDs, avID, blockID, previousID, content, isDetached, ignoreFillFilter) if nil != err { ret.Code = -1 ret.Msg = err.Error() diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index ee332b4b1..97190c548 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -2165,14 +2165,14 @@ func setAttributeViewColumnCalc(operation *Operation) (err error) { } func (tx *Transaction) doInsertAttrViewBlock(operation *Operation) (ret *TxErr) { - err := AddAttributeViewBlock(tx, operation.SrcIDs, operation.AvID, operation.BlockID, operation.PreviousID, operation.IsDetached, operation.IgnoreFillFilterVal) + err := AddAttributeViewBlock(tx, operation.SrcIDs, operation.AvID, operation.BlockID, operation.PreviousID, operation.Name, operation.IsDetached, operation.IgnoreFillFilterVal) if nil != err { return &TxErr{code: TxErrWriteAttributeView, id: operation.AvID, msg: err.Error()} } return } -func AddAttributeViewBlock(tx *Transaction, srcIDs []string, avID, blockID, previousBlockID string, isDetached, ignoreFillFilter bool) (err error) { +func AddAttributeViewBlock(tx *Transaction, srcIDs []string, avID, blockID, previousBlockID, content string, isDetached, ignoreFillFilter bool) (err error) { for _, id := range srcIDs { var tree *parse.Tree if !isDetached { @@ -2188,14 +2188,14 @@ func AddAttributeViewBlock(tx *Transaction, srcIDs []string, avID, blockID, prev } } - if avErr := addAttributeViewBlock(avID, blockID, previousBlockID, id, isDetached, ignoreFillFilter, tree, tx); nil != avErr { + if avErr := addAttributeViewBlock(avID, blockID, previousBlockID, id, content, isDetached, ignoreFillFilter, tree, tx); nil != avErr { return avErr } } return } -func addAttributeViewBlock(avID, blockID, previousBlockID, addingBlockID string, isDetached, ignoreFillFilter bool, tree *parse.Tree, tx *Transaction) (err error) { +func addAttributeViewBlock(avID, blockID, previousBlockID, addingBlockID, content string, isDetached, ignoreFillFilter bool, tree *parse.Tree, tx *Transaction) (err error) { var node *ast.Node if !isDetached { node = treenode.GetNodeInTree(tree, addingBlockID) @@ -2215,7 +2215,6 @@ func addAttributeViewBlock(avID, blockID, previousBlockID, addingBlockID string, return } - var content string if !isDetached { content = getNodeRefText(node) }