Enable 1-hit redirect for item barcode searches
authorThomas Berezansky <tsbere@mvlc.org>
Mon, 20 Aug 2012 16:22:44 +0000 (12:22 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 19 Sep 2012 14:35:13 +0000 (10:35 -0400)
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Bill Erickson <berick@esilibrary.com>

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

index 7ef3dea..c85a0bb 100644 (file)
@@ -323,7 +323,7 @@ sub load_rresults {
         return $self->marc_expert_search(%args) if scalar($cgi->param("tag"));
         $self->timelog("Calling item barcode search");
         return $self->item_barcode_shortcut if (
-            $cgi->param("qtype") and ($cgi->param("qtype") eq "item_barcode")
+            $cgi->param("qtype") and ($cgi->param("qtype") eq "item_barcode") and not $internal
         );
         $self->timelog("Calling call number browse");
         return $self->call_number_browse_standalone if (
@@ -574,6 +574,9 @@ sub item_barcode_shortcut {
         );
         $self->timelog("Returned from calling get_records_and_facets() for item_barcode");
 
+        my $stat = $self->check_1hit_redirect($rec_ids);
+        return $stat if $stat;
+
         $self->ctx->{records} = [@data];
         $self->ctx->{search_facets} = {};
         $self->ctx->{hit_count} = scalar @data;