From: Liam Whalen Date: Thu, 24 Sep 2015 22:00:17 +0000 (-0700) Subject: LP#1499537 Fixed kpac.xml caching problem X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bc43002be5e6a77b4262d7fe0fc5e0504efefdcb;p=working%2FEvergreen.git LP#1499537 Fixed kpac.xml caching problem The EGKPacLoader.pm file caches the kpac.xml file in a global variable. However, we are using multiple kpac.xml files, which means sometimes the incorrect kpac.xml file is cached. This causes a problem becuase the owner attribute of the of the layout element specifies which OU to load the grid of images for. When using separate kpac.xml files there is only one layout element per file, and if the inccorect kpac.xml file is loaded for an OU, then no layout will be generated resulting in the missing images. Signed-off-by: Liam Whalen --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm index 32e394b594..0a0f8dc11c 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm @@ -232,21 +232,19 @@ 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( - $path, - KeyAttr => ['id'], - ForceArray => ['layout', 'page', 'cell'], - NormaliseSpace => 2 - ); + if (!$path) { + $self->apache->log->error("KPacConfigFile required!"); + return; } + + $kpac_config = XMLin( + $path, + KeyAttr => ['id'], + ForceArray => ['layout', 'page', 'cell'], + NormaliseSpace => 2 + ); my $ou = $ctx->{physical_loc} || $self->_get_search_lib; my $layout;