kpac : ensure the single-hit redirect goes to kpac
authorBill Erickson <berick@esilibrary.com>
Mon, 9 Apr 2012 19:26:40 +0000 (15:26 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 30 Jul 2012 19:03:22 +0000 (15:03 -0400)
... instead of to the tpac record detail page.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm

index 5c80f92..a0637cf 100644 (file)
@@ -27,7 +27,7 @@ sub load {
 
     return $self->load_simple("home") if $path =~ m|kpac/home|;
     return $self->load_simple("category") if $path =~ m|kpac/category|;
-    return $self->load_rresults if $path =~ m|kpac/results|;
+    return $self->load_kpac_rresults if $path =~ m|kpac/results|;
     return $self->load_record(no_search => 1) if $path =~ m|kpac/record|; 
 
     # ----------------------------------------------------------------
@@ -48,6 +48,21 @@ sub load {
     return Apache2::Const::OK;
 }
 
+sub load_kpac_rresults {
+    my $self = shift;
+
+    # The redirect-to-record-details-on-single-hit logic
+    # leverages the opac_root to determine the record detail
+    # page.  Replace it temporarily for our purposes.
+    my $tpac_root = $self->ctx->{opac_root};
+    $self->ctx->{opac_root} = $self->ctx->{kpac_root};
+
+    my $stat = $self->load_rresults;
+    $self->ctx->{opac_root} = $tpac_root;
+
+    return $stat;
+}
+
 sub load_getit {
     my $self = shift;
     my $ctx = $self->ctx;