Browse Source

:art: Supports creating different docs when the database primary key content is the same https://github.com/siyuan-note/siyuan/issues/11713

Daniel 1 year ago
parent
commit
3fecb9d0e9
1 changed files with 2 additions and 1 deletions
  1. 2 1
      kernel/model/search.go

+ 2 - 1
kernel/model/search.go

@@ -400,11 +400,12 @@ func SearchRefBlock(id, rootID, keyword string, beforeLen int, isSquareBrackets,
 
 
 	if !isDatabase {
 	if !isDatabase {
 		// 如果非数据库中搜索块引,则不允许新建重名文档
 		// 如果非数据库中搜索块引,则不允许新建重名文档
-		// 如果是数据库中搜索绑定块,则允许新建重名文档 https://github.com/siyuan-note/siyuan/issues/11713
 		if block := treenode.GetBlockTree(id); nil != block {
 		if block := treenode.GetBlockTree(id); nil != block {
 			p := path.Join(block.HPath, keyword)
 			p := path.Join(block.HPath, keyword)
 			newDoc = nil == treenode.GetBlockTreeRootByHPath(block.BoxID, p)
 			newDoc = nil == treenode.GetBlockTreeRootByHPath(block.BoxID, p)
 		}
 		}
+	} else { // 如果是数据库中搜索绑定块,则允许新建重名文档 https://github.com/siyuan-note/siyuan/issues/11713
+		newDoc = true
 	}
 	}
 
 
 	// 在 hPath 中加入笔记本名 Show notebooks in hpath of block ref search list results https://github.com/siyuan-note/siyuan/issues/9378
 	// 在 hPath 中加入笔记本名 Show notebooks in hpath of block ref search list results https://github.com/siyuan-note/siyuan/issues/9378