How to reproduce:
1. Open the attached project "Repro_UITAuthoring"
2. Drop the "Assets/UITAuthoringRepro/CreateTemplateHost.uxml" into the Scene and click "Edit in UI Viewport"
3. Right-click the "doc-root" element in the Hierarchy and select "Create Template..."
4. In the save panel, choose the existing "Assets/UITAuthoringRepro/Leaf.uxml" and confirm the overwrite
5. Observe Leaf.uxml and CreateTemplateHost.uxml
Expected results: The operation is refused because "doc-root" instantiates Leaf.uxml and saving over it would make the document instantiate itself
Actual results: Leaf.uxml is overwritten with content that instantiates Leaf.uxml, the self-reference is dropped on import, and the original contents of Leaf.uxml are lost with no error or warning
Reproducible with: 6000.7.0a6
Can't test with: 6000.3.17f1, 6000.5.10f1, 6000.6.0f1, 6000.7.0a5 (No such functionality)
Reproducible on: Ubuntu 24.04.4 LTS (x86_64), macOS Tahoe 26 (M1)
Not reproducible on: No other environment tested
Note:
Multiple errors are thrown:
- (2,6): Semantic - The specified URI contains a circular dependency: Assets/UITAuthoringRepro/Leaf.uxml
- (4,10): Semantic - Unknown template name 'Leaf'