Fix failure of 'My Selection Lists' interface
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 3 Apr 2012 15:16:16 +0000 (11:16 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 3 Apr 2012 16:43:24 +0000 (12:43 -0400)
Addresses this bug: https://bugs.launchpad.net/evergreen/+bug/967824

Recent changes to the mechanism of unified search (for which 'My
Selection Lists' is a frontend) lacked code that respected
the new join structure for some use cases.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>

Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Search.pm

index fdad64f..109284c 100644 (file)
@@ -267,14 +267,7 @@ sub add_au_joins {
     my $n = 0;
     foreach my $join (@_) {
         my ($hint, $attr, $num) = @$join;
-        my $start;
-        if ($hint eq "jub") {
-            $start = $from->{$hint};
-        } elsif ($hint eq "acqinv") {
-            $start = $from->{"jub"}->{"acqie"}->{"join"}->{$hint};
-        } else {
-            $start = $from->{"jub"}->{$hint};
-        }
+        my $start = $from->{"acqus"}{$hint};
         my $clause = {
             "class" => "au",
             "type" => "left",
@@ -289,12 +282,8 @@ sub add_au_joins {
                 }
             }
         };
-        if ($hint eq "jub") {
-            $start->{"au$num"} = $clause;
-        } else {
-            $start->{"join"} ||= {};
-            $start->{"join"}->{"au$num"} = $clause;
-        }
+        $start->{"join"} ||= {};
+        $start->{"join"}->{"au$num"} = $clause;
         $n++;
     }
     $n;
@@ -417,7 +406,7 @@ q/order_by clause must be of the long form, like:
 
     $and_terms = prepare_terms($and_terms, 1);
     $or_terms = prepare_terms($or_terms, 0) and do {
-        $query->{"from"}->{"jub"}->{"acqlia"} = {
+        $query->{"from"}{"acqus"}{"jub"}{"join"}{"acqlia"} = {
             "type" => "left", "field" => "lineitem", "fkey" => "id",
         };
     };