[open-ils-commits] [GIT] Evergreen ILS branch master updated. 31563d8f54fd65d318635375b3b07520bf7bfc31

Evergreen Git git at git.evergreen-ils.org
Tue Aug 9 13:22:24 EDT 2016


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  31563d8f54fd65d318635375b3b07520bf7bfc31 (commit)
      from  5a5834d993e2ad7b4e9fdce9e839b956414a9ab3 (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 31563d8f54fd65d318635375b3b07520bf7bfc31
Author: Liam Whalen <liam.whalen at bc.libraries.coop>
Date:   Thu Sep 24 15:00:17 2015 -0700

    LP#1499537 Fixed kpac.xml caching problem
    
    KPAC config files must be cached per config path in order to support
    cases where more than one KPAC interface has been configured in different
    vhosts or locations.
    
    Signed-off-by: Liam Whalen <liam.whalen at bc.libraries.coop>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm
index 7f944c7..bfc9913 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm
@@ -7,7 +7,7 @@ use OpenSRF::Utils::Logger qw/$logger/;
 use OpenILS::Application::AppUtils;
 use OpenILS::Utils::CStoreEditor qw/:funcs/;
 my $U = 'OpenILS::Application::AppUtils';
-my $kpac_config;
+my %kpac_config;
 
 # -----------------------------------------------------------------------------
 # Override our parent's load() sub so we can do kpac-specific path routing.
@@ -237,15 +237,16 @@ sub load_kpac_config {
     my $self = shift;
     my $ctx = $self->ctx;
 
-    if (!$kpac_config) {
-        my $path = $self->apache->dir_config('KPacConfigFile');
+    my $path = $self->apache->dir_config('KPacConfigFile');
 
-        if (!$path) {
-            $self->apache->log->error("KPacConfigFile required!");
-            return;
-        }
-        
-        $kpac_config = XMLin(
+    if (!$path) {
+        $self->apache->log->error("KPacConfigFile required!");
+        return;
+    }
+
+    if (!$kpac_config{$path}) {
+    
+        $kpac_config{$path} = XMLin(
             $path,
             KeyAttr => ['id'],
             ForceArray => ['layout', 'page', 'cell'],
@@ -258,16 +259,16 @@ sub load_kpac_config {
 
     # Search up the org tree to find the nearest config for the context org unit
     while (my $org = $ctx->{get_aou}->($ou)) {
-        ($layout) = grep {$_->{owner} eq $org->id} @{$kpac_config->{layout}};
+        ($layout) = grep {$_->{owner} eq $org->id} @{$kpac_config{$path}->{layout}};
         last if $layout;
         $ou = $org->parent_ou;
     }
 
     $ctx->{kpac_layout} = $layout;
-    $ctx->{kpac_config} = $kpac_config;
+    $ctx->{kpac_config} = $kpac_config{$path};
     $ctx->{kpac_root} = $ctx->{base_path} . "/kpac"; 
     $ctx->{home_page} = $ctx->{proto} . '://' . $ctx->{hostname} . $ctx->{kpac_root} . "/home";
-    $ctx->{global_search_filter} = $kpac_config->{global_filter};
+    $ctx->{global_search_filter} = $kpac_config{$path}->{global_filter};
 }
 
 

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

Summary of changes:
 .../src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm   |   25 ++++++++++---------
 1 files changed, 13 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list