CMS 1.08 bug in admin/addtemplate.php
Posted: Tue Jul 03, 2007 11:47 pm
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";
}
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";
}