If the get credentials template is deleted, give an error message instead of

silently dying and returning to the page from the cart interface.
This commit is contained in:
Colin Kuskie 2009-02-17 23:59:07 +00:00
parent 30158b7f8d
commit 41e56932e6
3 changed files with 16 additions and 3 deletions

View file

@ -668,7 +668,6 @@ sub www_getCredentials {
# Process form errors
$var->{errors} = [];
#### TODO: i18n
if ($errors) {
$var->{error_message} = $i18n->get('error occurred message');
foreach my $error (@{ $errors} ) {
@ -743,8 +742,16 @@ sub www_getCredentials {
});
my $template = WebGUI::Asset::Template->new($session, $self->get("credentialsTemplateId"));
$template->prepare;
return $session->style->userStyle($template->process($var));
my $output;
if (defined $template) {
$template->prepare;
$output = $template->process($var);
}
else {
$output = $i18n->get('template gone');
}
return $session->style->userStyle($output);
}
#-------------------------------------------------------------------

View file

@ -292,6 +292,11 @@ our $I18N = {
lastUpdated => 0,
context => q|The default description of purchase of users.|
},
'template gone' => {
message => q|The template for entering in credentials has been deleted. Please notify the site administrator.|,
lastUpdated => 0,
context => q|Error message when the getCredentials template cannot be accessed.|
},
'show terminal' => {
message => q|Click here to use your virtual terminal.|,
lastUpdated => 0,