From 1f10da4df50b6b4605c95e8ed5f6fb2d3e8f57bd Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Thu, 21 Sep 2017 13:51:41 -0400 Subject: [PATCH] LP#1717777: Ensure the en-US is always represented in the dropdown The assumption of an array in the eval'd code was causing the forced en_us tag to fail. Here we push the default en_us into the list of locales in a more structured way to ensure that failure doesn't happen. Signed-off-by: Mike Rylander Signed-off-by: Ben Shum --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm index 965c7ca0f8..8dc09cb8d2 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm @@ -374,7 +374,7 @@ sub find_template { sub load_locale_handlers { my $ctx = shift; my @raw = @_; - my %locales; + my %locales = (en_us => []); while (@raw) { my ($l,$file) = (shift(@raw),shift(@raw)); $locales{$l} ||= []; @@ -384,9 +384,6 @@ sub load_locale_handlers { my $editor = new_editor(); my @locale_tags = sort { length($a) <=> length($b) } keys %locales; - # always fall back to en_us, the assumed template language - push(@locale_tags, 'en_us'); - for my $idx (0..$#locale_tags) { my $tag = $locale_tags[$idx]; -- 2.43.2