From: Lebbeous Fogle-Weekley Date: Mon, 21 May 2012 18:22:40 +0000 (-0400) Subject: Makes a warning go away when running fts-replacement.pl, but may have... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f09d75c476244080512e143366a38cde683e192b;p=evergreen%2Fmasslnc.git 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 --- 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 793a38d85d..3e9d10e838 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}};