Page 1 of 1

CMS 1.08 bug in admin/addtemplate.php

Posted: Tue Jul 03, 2007 11:47 pm
by ajlaird_au
When reporting an error in inserting a template, the error message for an insert failure includes the query used to check for duplicate template names. This is misleading as the query is totally irrelevant to the error at that point.

if ($result)
{
#Perform the addtemplate_post callback
foreach($gCms->modules as $key=>$value)
{
if ($gCms->modules[$key]['installed'] == true &&
$gCms->modules[$key]['active'] == true)
{
$gCms->modules[$key]['object']->AddTemplatePost($newtemplate);
}
}

Events::SendEvent('Core', 'AddTemplatePost', array('template' => &$newtemplate));

audit($newtemplate->id, $template, 'Added Template');
redirect("listtemplates.php");
return;
}
else
{
$error .= "".lang('errorinsertingtemplate')."$query";
}