浏览代码

:art: Database-bound block primary key supports setting static anchor text https://github.com/siyuan-note/siyuan/issues/10049

Daniel 6 月之前
父节点
当前提交
077a46ac70
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      kernel/model/attribute_view.go

+ 3 - 3
kernel/model/attribute_view.go

@@ -3112,7 +3112,7 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID string, valueDa
 						return
 					}
 
-					updateBlockValueStaticText(node, tree, avID, strings.TrimSpace(val.Block.Content))
+					updateBlockValueStaticText(tx, node, tree, avID, strings.TrimSpace(val.Block.Content))
 				}
 			}
 		}
@@ -3281,12 +3281,12 @@ func bindBlockAv0(tx *Transaction, avID string, node *ast.Node, tree *parse.Tree
 	return
 }
 
-func updateBlockValueStaticText(node *ast.Node, tree *parse.Tree, avID, text string) {
+func updateBlockValueStaticText(tx *Transaction, node *ast.Node, tree *parse.Tree, avID, text string) {
 	attrs := parse.IAL2Map(node.KramdownIAL)
 	attrs[av.NodeAttrViewStaticText+"-"+avID] = text
 	var err error
 	if nil != tree {
-		err = setNodeAttrsWithTx(nil, node, tree, attrs)
+		err = setNodeAttrsWithTx(tx, node, tree, attrs)
 	} else {
 		err = setNodeAttrs(node, nil, attrs)
 	}