Commit 93295f20 authored by Christophe Maudoux's avatar Christophe Maudoux

Load default template if does not exist (#1653)

parent 16cb5693
......@@ -241,9 +241,12 @@ sub sendHtml {
$args{code} ||= 200;
$args{headers} ||= $req->respHeaders || [];
my $htpl;
my $tmpl = $template;
$template = ( $args{templateDir} // $self->templateDir ) . "/$template.tpl";
unless (-f $template){
$template = $self->templateDir . "/bootstrap/$template.tpl";
$self->logger->debug("$template NOT found!!!");
$template = $self->conf->{templateDir} . '/bootstrap/' . "$tmpl.tpl";
$self->logger->debug("-> Try to load $template");
}
return $self->sendError( $req, "Unable to read $template", 500 )
unless ( -r $template and -f $template );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment