From f09d75c476244080512e143366a38cde683e192b 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 Signed-off-by: Dan Scott --- .../Application/Storage/Driver/Pg/QueryParser.pm | 14 +++++++++++--- 1 files 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 793a38d..3e9d10e 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 @@ -757,9 +757,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}}; -- 1.7.2.5