From d4383cf89f87d4c594c8155fbe52dc728c39da71 Mon Sep 17 00:00:00 2001 From: senator Date: Tue, 6 Apr 2010 19:19:55 +0000 Subject: [PATCH] Acq: bug fix. Thinko let to unintended search term negation in unified search. git-svn-id: svn://svn.open-ils.org/ILS/trunk@16144 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Acq/Search.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Search.pm b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Search.pm index 24e1b921c..d1d34477e 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Search.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Search.pm @@ -182,13 +182,19 @@ sub prepare_au_terms { $links->{$attr}->{"class"} eq "au") { push @joins, [$plain_hint, $attr, $join_num]; my $au_term = gen_au_term($value, $join_num); - $au_term = {"-not" => $au_term} if $nots--; + if ($nots > 0) { + $au_term = {"-not" => $au_term}; + $nots--; + } push @new_outer_terms, $au_term; $join_num++; delete $hint_unit->{$hint}; } } - $hint_unit = {"-not" => $hint_unit} if $nots--; + if ($nots > 0) { + $hint_unit = {"-not" => $hint_unit}; + $nots--; + } push @new_outer_terms, $hint_unit if scalar keys %$hint_unit; } $terms->{$conj} = [ @new_outer_terms ]; -- 2.11.0