}
if ($tmpl->id) {
+ $oo = clone($tmpl);
$tmpl->is_deleted = 0;
$tmpl->filetype = $filetype;
$tmpl->updated = date('Y-m-d H:i:s', filemtime($tmpl->currentTemplate));
- $tmpl->update($tmpl);
+ $tmpl->update($oo);
} else {
$tmpl->is_deleted = 0;
$tmpl->filetype = $filetype;