Update Account.pm for WebGUI::Definition and exceptions.

This commit is contained in:
Colin Kuskie 2010-01-28 13:15:47 -08:00
parent f92f0d706a
commit d8265febd6

View file

@ -482,9 +482,11 @@ sub processTemplate {
return sprintf($i18n->get('Error: Cannot instantiate template'),$templateId,$className);
}
$template = WebGUI::Asset->new($session, $templateId,"WebGUI::Asset::Template") unless (defined $template);
if (!defined $template) {
$template = eval { WebGUI::Asset->newById($session, $templateId); };
}
unless (defined $template) {
if (Exception::Class->caught()) {
$session->log->error("Can't instantiate template $templateId for class ".$className);
my $i18n = WebGUI::International->new($session, 'Account');
return sprintf($i18n->get('Error: Cannot instantiate template'),$templateId,$className);