[BUG]XML Parse Error Pasting Template XML

I accidentally cut a template from the project browser. It's still in my clipboard, I can see the XML code. How can I get it back into my project?

There is a warning when deleting templates, but not when cutting. That should probably be updated.

I found the option to paste xml on a newly created template using shift + right click to "set XML" but I got a premature end of file. Guess I'll just have to start from the last backup that I have. Not too much lost...

I got a premature end of file parse exception on line 2, column 10. Not sure why... here's the top of the file

<?xml version="1.0" encoding="UTF-8"?>
<objects fpmi.archive.type="template" framework.version="" com.inductiveautomation.vision.version="" timestamp="Fri Jan 12 12:50:15 CST 2024">
	<c id="144" cls="com.inductiveautomation.factorypmi.application.components.template.VisionTemplate">

column 10 would be the "f" after object....?

After further investigation, I found that even copying a known good template's XML into a new template generates an error.

This time I get a "Error reading head" error - unexpected end of ZLIB input stream

After talking to support, this is a result of how the project stores resources. In 8.1.25 an option to store resources as binary, XML, or "auto" was added.

Setting this to XML instead of auto allows the copy/paste of XML templates to work.