LP1629108 Finalizing Search.pm removing if block
authorblake <blake@mobiusconsortium.org>
Fri, 10 Feb 2017 03:14:24 +0000 (21:14 -0600)
committerKathy Lussier <klussier@masslnc.org>
Wed, 15 Feb 2017 04:31:03 +0000 (23:31 -0500)
For ease of diffing, I left the old if block in place because removing it would
cause all of the lines to show changes when in fact it was just spacing. This commit
simply removes the if block and the spacing is the only change.

Signed-off-by: blake <blake@mobiusconsortium.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>

Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm

index 2d7a8d8..ad057d3 100644 (file)
@@ -412,52 +412,41 @@ sub load_rresults {
     # the query string, not special args.
     my $args = {'limit' => $limit, 'offset' => $offset};
 
-    if (0) { #($metarecord) {
-        my $bre_ids = $self->recs_from_metarecord(
-            $metarecord, $ctx->{search_ou}, $depth);
-       
-        # force the metarecord result blob to match the format of regular search results
-        $results->{ids} = [map { [$_] } @$bre_ids];
-        $results->{count} = scalar(@{$results->{ids}});
+    return Apache2::Const::OK unless $query;
 
-    } else {
-
-        return Apache2::Const::OK unless $query;
-
-        if ($tag_circs) {
-            $args->{tag_circulated_records} = 1;
-            $args->{authtoken} = $self->editor->authtoken;
-        }
-        $args->{from_metarecord} = $metarecord if $metarecord;
+    if ($tag_circs) {
+        $args->{tag_circulated_records} = 1;
+        $args->{authtoken} = $self->editor->authtoken;
+    }
+    $args->{from_metarecord} = $metarecord if $metarecord;
 
-        # Stuff these into the TT context so that templates can use them in redrawing forms
-        $ctx->{user_query} = $user_query;
-        $ctx->{processed_search_query} = $query;
+    # Stuff these into the TT context so that templates can use them in redrawing forms
+    $ctx->{user_query} = $user_query;
+    $ctx->{processed_search_query} = $query;
 
-        $query = "$_ $query" for @facets;
+    $query = "$_ $query" for @facets;
 
-        my $ltag = $is_meta ? '[mmr search]' : '[bre search]';
-        $logger->activity("EGWeb: $ltag $query");
+    my $ltag = $is_meta ? '[mmr search]' : '[bre search]';
+    $logger->activity("EGWeb: $ltag $query");
 
-        try {
+    try {
 
-            my $method = 'open-ils.search.biblio.multiclass.query';
-            $method .= '.staff' if $ctx->{is_staff};
-            $method =~ s/biblio/metabib/ if $is_meta;
+        my $method = 'open-ils.search.biblio.multiclass.query';
+        $method .= '.staff' if $ctx->{is_staff};
+        $method =~ s/biblio/metabib/ if $is_meta;
 
-            my $ses = OpenSRF::AppSession->create('open-ils.search');
+        my $ses = OpenSRF::AppSession->create('open-ils.search');
 
-            $self->timelog("Firing off the multiclass query");
-            my $req = $ses->request($method, $args, $query, 1);
-            $results = $req->gather(1);
-            $self->timelog("Returned from the multiclass query");
+        $self->timelog("Firing off the multiclass query");
+        my $req = $ses->request($method, $args, $query, 1);
+        $results = $req->gather(1);
+        $self->timelog("Returned from the multiclass query");
 
-        } catch Error with {
-            my $err = shift;
-            $logger->error("multiclass search error: $err");
-            $results = {count => 0, ids => []};
-        };
-    }
+    } catch Error with {
+        my $err = shift;
+        $logger->error("multiclass search error: $err");
+        $results = {count => 0, ids => []};
+    };
 
     my $rec_ids = [map { $_->[0] } @{$results->{ids}}];