From 52cda2fc1da5dd2f493c4b1fab71b7c69489bd72 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 25 Apr 2018 09:21:30 +0200 Subject: [PATCH] Bug 20538: Prevent warnings in xt/author/valid-templates.t --- xt/author/valid-templates.t | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xt/author/valid-templates.t b/xt/author/valid-templates.t index b7baf55f73..9d195373e0 100644 --- a/xt/author/valid-templates.t +++ b/xt/author/valid-templates.t @@ -117,6 +117,10 @@ sub run_template_test { sub create_template_test { my $includes = shift; my @exclusions = @_; + + my $interface = $includes =~ s|^.*/([^/]*-tmpl).*$|$1|r; + my $theme = ($interface =~ /opac/) ? 'bootstrap' : 'prog'; + return sub { my $tt = Template->new( { @@ -131,7 +135,7 @@ sub create_template_test { return; } } - my $vars; + my $vars = { interface => $interface, theme => $theme }; my $output; if ( ! -d $_ ) { # skip dirs if ( !ok( $tt->process( $_, $vars, \$output ), $_ ) ) { -- 2.14.2