mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	fix consistency check to re-parent note from search parent to root
This commit is contained in:
		| @@ -443,10 +443,17 @@ class ConsistencyChecks { | ||||
|                     const branches = branchIds.map(branchId => becca.getBranch(branchId)); | ||||
|  | ||||
|                     for (const branch of branches) { | ||||
|                         branch.parentNoteId = 'root'; | ||||
|                         branch.save(); | ||||
|                         // delete the old wrong branch | ||||
|                         branch.markAsDeleted("parent-is-search"); | ||||
|  | ||||
|                         logFix(`Child branch '${branch.branchId}' has been moved to root since it was a child of a search note '${parentNoteId}'`) | ||||
|                         // create a replacement branch in root parent | ||||
|                         new Branch({ | ||||
|                             parentNoteId: 'root', | ||||
|                             noteId: branch.noteId, | ||||
|                             prefix: 'recovered' | ||||
|                         }).save(); | ||||
|  | ||||
|                         logFix(`Note '${branch.noteId}' has been moved to root since it was a child of a search note '${parentNoteId}'`) | ||||
|                     } | ||||
|  | ||||
|                     this.reloadNeeded = true; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user