[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch master updated. 67a2d15be9af1ad8662bf4a58b2a1fbcb0284c50

Evergreen Git git at git.evergreen-ils.org
Wed Nov 6 13:16:39 EST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  67a2d15be9af1ad8662bf4a58b2a1fbcb0284c50 (commit)
       via  859d49c348c3336789c2886e664fe6b0cf1a7bb7 (commit)
      from  4a6345d0383ba3b7b0f73aca06eafa5a8adab1a4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 67a2d15be9af1ad8662bf4a58b2a1fbcb0284c50
Author: Bill Erickson <berick at esilibrary.com>
Date:   Thu Jun 6 10:02:27 2013 -0400

    Remove manual TPAC locale applications
    
    OpenILS::Utils::CStoreEditor::default_locale is no longer set, since the
    opensrf client locale is now global.  Remove all references to this
    variable.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
index 976940f..e372267 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
@@ -61,7 +61,6 @@ sub load_record {
     # run copy retrieval in parallel to bib retrieval
     # XXX unapi
     my $cstore = OpenSRF::AppSession->create('open-ils.cstore');
-    $cstore->session_locale($OpenILS::Utils::CStoreEditor::default_locale);
     my $copy_rec = $cstore->request(
         'open-ils.cstore.json_query.atomic', 
         $self->mk_copy_query($rec_id, $org, $copy_depth, $copy_limit, $copy_offset, $pref_ou)
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
index e520ff5..1a8740c 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
@@ -419,7 +419,6 @@ sub load_rresults {
             $method .= '.staff' if $ctx->{is_staff};
 
             my $ses = OpenSRF::AppSession->create('open-ils.search');
-            $ses->session_locale($OpenILS::Utils::CStoreEditor::default_locale); # set in EGWeb
 
             $self->timelog("Firing off the multiclass query");
             my $req = $ses->request($method, $args, $query, 1);

commit 859d49c348c3336789c2886e664fe6b0cf1a7bb7
Author: Bill Erickson <berick at esilibrary.com>
Date:   Thu May 23 15:20:14 2013 -0400

    Default per-request TPAC locale
    
    Set the OpenSRF default client locale for each TPAC request to ensure
    all outbound OpenSRF calls use the requested locale.  When done, reset
    the locale to the OpenSRF default.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm
index e5d5bb2..57cb02b 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm
@@ -8,6 +8,7 @@ use Encode;
 use Apache2::Const -compile => qw(OK DECLINED HTTP_INTERNAL_SERVER_ERROR);
 use Apache2::Log;
 use OpenSRF::EX qw(:try);
+use OpenSRF::AppSession;
 use OpenILS::Utils::CStoreEditor q/:funcs/;
 use List::MoreUtils qw/uniq/;
 
@@ -20,6 +21,18 @@ my %registered_locales;
 
 sub handler {
     my $r = shift;
+    my $stat = handler_guts($r);
+
+    # other opensrf clients share this apache process,
+    # so it's critical to reset the locale after each
+    # response is handled, lest the other clients 
+    # adopt our temporary, global locale value.
+    OpenSRF::AppSession->reset_locale;
+    return $stat;
+}
+    
+sub handler_guts {
+    my $r = shift;
     my $ctx = load_context($r);
     my $base = $ctx->{base_path};
 
@@ -173,7 +186,7 @@ sub load_context {
         parse_accept_lang($r->headers_in->get('Accept-Language'));
 
     # set the editor default locale for each page load
-    $OpenILS::Utils::CStoreEditor::default_locale = parse_eg_locale($ctx->{locale});
+    OpenSRF::AppSession->default_locale(parse_eg_locale($ctx->{locale}));
 
     my $mprefix = $ctx->{media_prefix};
     if($mprefix and $mprefix !~ /^http/ and $mprefix !~ /^\//) {

-----------------------------------------------------------------------

Summary of changes:
 .../perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm |    1 -
 .../perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm |    1 -
 Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm     |   15 ++++++++++++++-
 3 files changed, 14 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list