From 049ffc264f8bb866cc1f006f73a1e382da1dac69 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 17 Apr 2012 10:35:43 -0400 Subject: [PATCH] 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 Conflicts: Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm Signed-off-by: Mike Rylander --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm index 71a520ce28..f44a0af977 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 q/:funcs/; +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'); -- 2.43.2