From 36592af1e51f4534fcf2207de19706c19daf9efe Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 18 Apr 2012 16:15:46 -0400 Subject: [PATCH] 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 --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.11.0