From 0daca55f54aacea34acf78cde378d2c49b165bf5 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Fri, 17 Jan 2014 18:55:26 -0500 Subject: [PATCH] Need to distinguish between controlled and uncontrolled attributes when finding value IDs Signed-off-by: Mike Rylander --- .../lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm index 997c94f1b6..147b16571e 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm @@ -713,8 +713,10 @@ sub dynamic_filter_compile { my $method = $_dfilter_controlled_cache{$filter}{controlled} ? 'search_config_coded_value_map' : 'search_metabib_uncontrolled_record_attr_value'; - my $match_field = $_dfilter_controlled_cache{$filter}{controlled} ? + my $attr_field = $_dfilter_controlled_cache{$filter}{controlled} ? 'ctype' : 'attr'; + my $value_field = $_dfilter_controlled_cache{$filter}{controlled} ? + 'code' : 'value'; return sprintf('%s(%s)', $negate, join( @@ -722,7 +724,7 @@ sub dynamic_filter_compile { map { $_->id } @{ - $e->$method({ $match_field => $filter, code => $params }) + $e->$method({ $attr_field => $filter, $value_field => $params }) } ) ); -- 2.11.0