Hi @NielsKlazenga,
The “Repair Tree” option only rebuilds the node numbers for the selected tree, not the full names. It might just be the right place to integrate this functionality into the UI!
Technical Details
When you click Repair Tree in the User Tools menu, it runs two functions to renumber the tree and validate that the numbering is correct.
renumber_tree function
This function repairs or rebuilds the tree numbering system by:
- Updating each node’s rank to match its full name definition in the tree schema
- Checking for and warning about invalid parent-child rank relationships
- Creating a complete path enumeration for each node in the tree
- Assigning new node numbers based on the hierarchical paths
- Setting proper highest child node numbers for parent nodes
- Clearing any maintenance flags in the system related to tree nodes
validate_tree_numbering function
This function checks if the hierarchical tree structure is valid by:
- Verifying that all nodes have
nodenumberandhighestchildnodenumberset - Ensuring children have higher ranks than their parents (maintaining proper hierarchy)
- Confirming that child node numbers are properly nested within their parent’s range