+ The “OnDocFormPrerender” and “OnDocFormRender” events now have the document template ID parameter.

...ument template ID parameter.
Maybe (int)$_REQUEST['newtemplate']? See the 724 line.