[open-ils-commits] r16144 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq (senator)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Apr 6 15:20:00 EDT 2010


Author: senator
Date: 2010-04-06 15:19:55 -0400 (Tue, 06 Apr 2010)
New Revision: 16144

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Search.pm
Log:
Acq: bug fix. Thinko let to unintended search term negation in unified search.


Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Search.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Search.pm	2010-04-06 18:23:29 UTC (rev 16143)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Search.pm	2010-04-06 19:19:55 UTC (rev 16144)
@@ -182,13 +182,19 @@
                     $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 ];



More information about the open-ils-commits mailing list