From d0063cd6e536f4a27925e8228f8a1622717f7974 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 7 Oct 2011 09:08:38 -0400 Subject: [PATCH] TPac: Jump-to-details on first result page only When activated, jump-to-record-details-on-1-hit should only come into play on the first page of results. In other words, if page 2 of a search has 1 item, do not jump to the record details page for that item. Instead, show page 2 of the search results. Signed-off-by: Bill Erickson --- .../perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm index 903dea75d4..eb5d7eadd1 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm @@ -263,8 +263,10 @@ sub load_rresults { } ); - my $stat = $self->check_1hit_redirect($rec_ids); - return $stat if $stat; + if ($page == 0) { + my $stat = $self->check_1hit_redirect($rec_ids); + return $stat if $stat; + } # shove recs into context in search results order for my $rec_id (@$rec_ids) { @@ -441,8 +443,10 @@ sub marc_expert_search { return Apache2::Const::OK if @{$self->ctx->{ids}} == 0 or $args{internal}; - my $stat = $self->check_1hit_redirect($self->ctx->{ids}); - return $stat if $stat; + if ($page == 0) { + my $stat = $self->check_1hit_redirect($self->ctx->{ids}); + return $stat if $stat; + } my ($facets, @data) = $self->get_records_and_facets( $self->ctx->{ids}, undef, {flesh => "{holdings_xml,mra}"} -- 2.43.2