From 136e731a0dcd6379b7cbbe9111f8a17edb7f96de Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 17 Jan 2017 16:58:39 -0500 Subject: [PATCH] LP#1657282: fix redirect of one-hit metarecord searches This patches fixes a bug where, when performing a metarecord ("Group Formats and Editions") search, one-hit result sets get redirected to a "/eg/opac/record/0.0..." page, which results in a "Bad Request" error being shown to the user. To test: [1] Perform a metarecord search that would result in exactly one metarecord search. Observe that the browser displays a "Bad Request" error page. [2] Apply the patch and perform step 1 again. This time, the search should succeed. Note that if the metarecord contains more than one component, a results page with one grouped hit is displayed; if the metarecord has exactly one component, that bib's record page is displayed. Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 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 7ee9cfae20..48c218a05b 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm @@ -496,9 +496,9 @@ sub load_rresults { my $stat = 0; if ($is_meta) { # if the MR has a single constituent record, it will - # be in array position 2 of the result blob. + # be in array position 4 of the result blob. # otherwise, we don't want to redirect anyway. - my $bre_id = $results->{ids}->[0]->[2]; + my $bre_id = $results->{ids}->[0]->[4]; $stat = $self->check_1hit_redirect([$bre_id]) if $bre_id; } else { my $stat = $self->check_1hit_redirect($rec_ids); -- 2.43.2