Jeremy Tinley reported the following issue with templates. The forum post is here:
https://www.virtualmin.com/forums/message-view?message%5fid=8844
He posted a patch that looks sane, but I'll let you decide on what to do with it.
Status:
Closed (fixed)