Correctly mark deleted versions in Versions::addToTemplate() (see #7442)