# Force full name reconstruction for taxon tree

**URL:** https://speciforum.org/t/force-full-name-reconstruction-for-taxon-tree/2713
**Category:** Get Help
**Created:** [July 17, 2025, 11:51am UTC](https://speciforum.org/t/force-full-name-reconstruction-for-taxon-tree/2713 "2025-07-17T11:51:48Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![Grant](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/grant/32/4255_2.png) [@Grant](https://speciforum.org/u/Grant)
#### Post date: [July 23, 2025, 8:54pm UTC](https://speciforum.org/t/force-full-name-reconstruction-for-taxon-tree/2713/4 "2025-07-23T20:54:12Z")

</div>

Hi @NielsKlazenga,

The “[Repair Tree](https://speciforum.org/t/user-tools-menu/536#p-810-repair-tree-11)” 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 `nodenumber` and `highestchildnodenumber` set
- Ensuring children have higher ranks than their parents (maintaining proper hierarchy)
- Confirming that child node numbers are properly nested within their parent’s range

> **Code References**
>
> [specify7/specifyweb/specify/tree\_views.py at f9cb3421767993a8c0ff504f86e94187d79a3dd9 · specify/specify7 · GitHub](https://github.com/specify/specify7/blob/f9cb3421767993a8c0ff504f86e94187d79a3dd9/specifyweb/specify/tree_views.py#L406-L415)  
> [specify7/specifyweb/specify/tree\_extras.py at f9cb3421767993a8c0ff504f86e94187d79a3dd9 · specify/specify7 · GitHub](https://github.com/specify/specify7/blob/f9cb3421767993a8c0ff504f86e94187d79a3dd9/specifyweb/specify/tree_extras.py#L642-L734)

---

_[View the full topic](https://speciforum.org/t/force-full-name-reconstruction-for-taxon-tree/2713)._
