From: Bill Erickson Date: Wed, 18 Apr 2012 20:15:46 +0000 (-0400) Subject: tpac : search_HINT cache fixes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=36592af1e51f4534fcf2207de19706c19daf9efe;p=evergreen%2Fjoelewis.git tpac : search_HINT cache fixes When searching for multiple values like a list of IDs, generate the cache key from the sorted JSON form of the search value instead of the bare ARRAY ref. Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm index 57b8407602..d9739470dc 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm @@ -73,6 +73,11 @@ sub init_ro_object_cache { my ($field, $val, $filterfield, $filterval) = @_; my $method = "search_$eclass"; my $cacheval = $val; + if (ref $val) { + $val = [sort(@$val)] if ref $val eq 'ARRAY'; + $cacheval = OpenSRF::Utils::JSON->perl2JSON($val); + #$self->apache->log->info("cacheval : $cacheval"); + } my $search_obj = {$field => $val}; if($filterfield) { $search_obj->{$filterfield} = $filterval;