[open-ils-commits] [GIT] Evergreen ILS branch master updated. 296264efe6fcef702bf87e1bf6dba3ced81b9645

Evergreen Git git at git.evergreen-ils.org
Tue Oct 18 12:09:33 EDT 2011


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  296264efe6fcef702bf87e1bf6dba3ced81b9645 (commit)
      from  0a3ba77bfb997d4896f9f8168057db39f4f14953 (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 296264efe6fcef702bf87e1bf6dba3ced81b9645
Author: Dan Scott <dscott at laurentian.ca>
Date:   Sun Oct 16 18:39:00 2011 -0400

    Cache open-ils.fielder results by locale
    
    The problem was particularly visible in search facets, but existed
    before: the cache key used for fielder results did not take locale into
    account, so on a multi-locale system the first locale won and populated
    the cache for all other locales.
    
    Use a session locale if provided, otherwise default to the locale set in
    opensrf.xml
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Fielder.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Fielder.pm
index 38a56c5..341b569 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Fielder.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Fielder.pm
@@ -36,6 +36,7 @@ my $log = 'OpenSRF::Utils::Logger';
 
 my $cache;
 my $cache_timeout;
+my $default_locale;
 my $parser = XML::LibXML->new();
 my $xslt = XML::LibXSLT->new();
 
@@ -56,6 +57,8 @@ sub initialize {
     $cache_timeout = $conf->config_value(
             "apps", "open-ils.fielder", "app_settings", "cache_timeout" ) || 300;
 
+    $default_locale = $conf->config_value("default", "default_locale") || 'en-US';
+
     generate_methods();
 
 }
@@ -68,6 +71,7 @@ sub fielder_fetch {
     my $client = shift;
     my $obj = shift;
 
+    my $locale = $self->session->session_locale || $default_locale;
     my $query = $obj->{query};
     my $nocache = $obj->{cache} ? 0 : 1;
     my $fields = $obj->{fields};
@@ -98,7 +102,8 @@ sub fielder_fetch {
             $qstring .
             $fstring .
             $distinct .
-            $obj_class
+            $obj_class .
+            $locale
         );
 
         $res = $cache->get_cache( $key );

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

Summary of changes:
 .../perlmods/lib/OpenILS/Application/Fielder.pm    |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list