diff --git a/Webperl/Application.pm b/Webperl/Application.pm index e22ea85..79573a2 100644 --- a/Webperl/Application.pm +++ b/Webperl/Application.pm @@ -160,6 +160,7 @@ sub run { # Create the template handler object $self -> {"template"} = Webperl::Template -> new(logger => $self -> {"logger"}, dbh => $self -> {"dbh"}, + cgi => $self -> {"cgi"}, basedir => $self -> {"settings"} -> {"config"} -> {"template_dir"} || "templates", timefmt => $self -> {"settings"} -> {"config"} -> {"timefmt"}, blockname => 1, diff --git a/Webperl/Template.pm b/Webperl/Template.pm index 1354a40..f7fca94 100644 --- a/Webperl/Template.pm +++ b/Webperl/Template.pm @@ -357,7 +357,8 @@ sub set_template_dir { $self -> {"templatepath"} .= "/" unless($self -> {"templatepath"} =~ m|/$|); # templatepath must have trailing slash # The URL... - $self -> {"templateurl"} = path_join($self -> {"cgi"} -> url(-base => 1), $self -> {"templatepath"}); + $self -> {"templateurl"} = path_join($self -> {"cgi"} -> url(-base => 1), $self -> {"templatepath"}) + if($self -> {"cgi"}); # And the common path, if possible if($self -> {"fallback"}) {