From f17e6fe6e191b0d99fb56cf9cfc2ac1bc1c5282e Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 17 Aug 2012 10:10:55 -0400 Subject: [PATCH] Set the default CStoreEditor locale on page load Ech CStoreEditor request will use the locale of the current page as the default opensrf session locale. Signed-off-by: Bill Erickson Signed-off-by: Dan Scott --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm index fc4374ca3f..eceeb9b861 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm @@ -171,6 +171,10 @@ sub load_context { $cgi->cookie(OILS_HTTP_COOKIE_LOCALE) || $default_locale || parse_accept_lang($r->headers_in->get('Accept-Language')); + + # set the editor default locale for each page load + $OpenILS::Utils::CStoreEditor::default_locale = $ctx->{locale}; + my $mprefix = $ctx->{media_prefix}; if($mprefix and $mprefix !~ /^http/ and $mprefix !~ /^\//) { # if a hostname is provided /w no protocol, match the protocol to the current page -- 2.11.0