Fix constructed method call syntax and a logic inversion
authorMike Rylander <miker@esilibrary.com>
Fri, 17 Jan 2014 22:32:01 +0000 (17:32 -0500)
committerMike Rylander <mrylander@gmail.com>
Wed, 29 Jan 2014 18:21:23 +0000 (13:21 -0500)
Signed-off-by: Mike Rylander <miker@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm

index 074d309..997c94f 100644 (file)
@@ -711,8 +711,8 @@ sub dynamic_filter_compile {
         $_dfilter_controlled_cache{$filter}{controlled} = scalar @$ccvm_list;
     }
 
-    my $method = 'search_' . $_dfilter_controlled_cache{$filter}{controlled} ?
-        'config_coded_value_map' : 'metabib_uncontrolled_record_attr_value';
+    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} ?
         'ctype' : 'attr';
 
@@ -722,9 +722,7 @@ sub dynamic_filter_compile {
             map {
                 $_->id
             } @{
-                OpenILS::Utils::CStoreEditor
-                    ->new
-                    ->$method({ $match_field => $filter, value => $params })
+                $e->$method({ $match_field => $filter, code => $params })
             }
         )
     );
@@ -1073,7 +1071,7 @@ sub flatten {
             my $vlist_query = $self->dynamic_filter_compile( $fname, $filter->args, $filter->negate );
 
             # bool joiner for intra-plan nodes/filters
-            push(@dlist, $self->joiner) if !@dlist;
+            push(@dlist, $self->joiner) if @dlist;
             push(@dlist, $vlist_query);
             $uses_mrv = 1;
         } else {