tpac/kpac : search_filter_group cache repairs
authorBill Erickson <berick@esilibrary.com>
Tue, 29 May 2012 16:05:16 +0000 (12:05 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 30 Jul 2012 19:05:05 +0000 (15:05 -0400)
Repaired bug in search_filter_group which lead to empty results
delivered when data was in the cache.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>

Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm

index 166875c..f94d60b 100644 (file)
@@ -523,7 +523,7 @@ sub load_search_filter_groups {
     for my $org_id (@$org_list) {
 
         my $grps;
-        if (!$cache{search_filter_groups}{$org_id}) {
+        if (! ($grps = $cache{search_filter_groups}{$org_id}) ) {
             $grps = $self->editor->search_actor_search_filter_group([
                 {owner => $org_id},
                 {   flesh => 2, 
@@ -535,7 +535,7 @@ sub load_search_filter_groups {
             ]);
             $cache{search_filter_groups}{$org_id} = $grps;
         }
-            
+
         # for the current context, if a descendant org has a group 
         # with a matching code replace the group from the parent.
         $seen{$_->code} = $_ for @$grps;