mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-20 19:10:49 +08:00
🎨 Improve copying database block https://github.com/siyuan-note/siyuan/issues/11460
断开双向关联 https://github.com/siyuan-note/siyuan/issues/11548
This commit is contained in:
parent
4066348644
commit
421b26b49e
@ -68,6 +68,15 @@ func DuplicateDatabaseBlock(avID string) (newAvID, newBlockID string, err error)
|
||||
}
|
||||
|
||||
newAv.Name = oldAv.Name + " (Duplicated " + time.Now().Format("2006-01-02 15:04:05") + ")"
|
||||
|
||||
for _, keyValues := range newAv.KeyValues {
|
||||
if nil != keyValues.Key.Relation && keyValues.Key.Relation.IsTwoWay {
|
||||
// 断开双向关联
|
||||
keyValues.Key.Relation.IsTwoWay = false
|
||||
keyValues.Key.Relation.BackKeyID = ""
|
||||
}
|
||||
}
|
||||
|
||||
data, err = gulu.JSON.MarshalJSON(newAv)
|
||||
if nil != err {
|
||||
logging.LogErrorf("marshal attribute view [%s] failed: %s", newAvID, err)
|
||||
|
Loading…
Reference in New Issue
Block a user