From: Bill Erickson Date: Tue, 17 Apr 2012 14:35:43 +0000 (-0400) Subject: EGWeb trim template paths to unique set X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=167a7c6cddf6b7c04d06afd90eeed5bc05dac199;p=working%2FEvergreen.git EGWeb trim template paths to unique set The list of template paths may have the same path added multiple times, depending on the Apache configuration. Trim them down to a unique set to avoid excess template lookups. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm index 66fb47ed6a..cd230309f3 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm @@ -9,6 +9,7 @@ use Apache2::Const -compile => qw(OK DECLINED HTTP_INTERNAL_SERVER_ERROR); use Apache2::Log; use OpenSRF::EX qw(:try); use OpenILS::Utils::CStoreEditor; +use List::MoreUtils qw/uniq/; use constant OILS_HTTP_COOKIE_SKIN => 'eg_skin'; use constant OILS_HTTP_COOKIE_THEME => 'eg_theme'; @@ -146,7 +147,7 @@ sub load_context { $ctx->{theme} = $cgi->cookie(OILS_HTTP_COOKIE_THEME) || 'default'; $ctx->{proto} = $cgi->https ? 'https' : 'http'; - my @template_paths = $r->dir_config->get('OILSWebTemplatePath'); + my @template_paths = uniq $r->dir_config->get('OILSWebTemplatePath'); $ctx->{template_paths} = [ reverse @template_paths ]; my %locales = $r->dir_config->get('OILSWebLocale');