From: Bill Erickson Date: Mon, 9 Apr 2012 19:26:40 +0000 (-0400) Subject: kpac : ensure the single-hit redirect goes to kpac X-Git-Tag: sprint4-merge-nov22~3989 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=727d0647b41d71b09d9a8b08dd906c723eb3fb50;p=working%2FEvergreen.git kpac : ensure the single-hit redirect goes to kpac ... instead of to the tpac record detail page. Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm index 5c80f92ea3..a0637cf84b 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm @@ -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;