From 0486e9da6a73ffb46ee40f1d7e3e8ae4e25ccb3f Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Mon, 21 May 2012 14:22:40 -0400 Subject: [PATCH] Makes a warning go away when running fts-replacement.pl, but may have... ...consequences. Signed-off-by: Lebbeous Fogle-Weekley --- .../OpenILS/Application/Storage/Driver/Pg/QueryParser.pm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 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 cbc13beb80..641e06dbce 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 @@ -743,9 +743,17 @@ sub flatten { if (@{$node->fields} > 0) { @bump_fields = @{$node->fields}; - my @field_ids; - push(@field_ids, $self->QueryParser->search_field_ids_by_class( $node->classname, $_ )->[0]) for (@bump_fields); - $from .= "\n\t\t\tWHERE fe_weight.id IN (". join(',', @field_ids) .")"; + my @field_ids = grep defined, ( + map { + $self->QueryParser->search_field_ids_by_class( + $node->classname, $_ + )->[0] + } @bump_fields + ); + if (@field_ids) { + $from .= "\n\t\t\tWHERE fe_weight.id IN (" . + join(',', @field_ids) . ")"; + } } else { @bump_fields = @{$self->QueryParser->search_fields->{$node->classname}}; -- 2.11.0