move template finder in front of context loader, so that context loader has access...
authorBill Erickson <berick@esilibrary.com>
Fri, 21 Jan 2011 21:08:50 +0000 (16:08 -0500)
committerBill Erickson <berick@esilibrary.com>
Fri, 21 Jan 2011 21:08:50 +0000 (16:08 -0500)
Open-ILS/src/perlmods/OpenILS/WWW/EGWeb.pm

index 4980f79..6d38a83 100644 (file)
@@ -35,14 +35,16 @@ sub handler {
     my $base = $ctx->{base_path};
 
     $r->content_type('text/html; encoding=utf8');
-    my $stat = run_context_loader($r, $ctx);
-    return $stat unless $stat == Apache2::Const::OK;
 
     my($template, $page_args, $as_xml) = find_template($r, $base, $ctx);
+    $ctx->{page_args} = $page_args;
+
+    my $stat = run_context_loader($r, $ctx);
+
+    return $stat unless $stat == Apache2::Const::OK;
     return Apache2::Const::DECLINED unless $template;
 
     $template = $ctx->{skin} . "/$template";
-    $ctx->{page_args} = $page_args;
 
     my $tt = Template->new({
         OUTPUT => ($as_xml) ?  sub { parse_as_xml($r, $ctx, @_); } : $r,