From 0064786e48203d8e396713d4b2fcef11adc19393 Mon Sep 17 00:00:00 2001 From: dbs Date: Sat, 29 Jan 2011 18:03:26 +0000 Subject: [PATCH] For more predictable authority browse results, use startwith until browse is sorted out authority_tag_sf_browse() was returning unexpected results when only a small set of authority records was loaded. This may be an indication of a corner case, but until we sort that out the more straightforward startwith should be used. Also, chop the final character of the incoming search value to ensure that an exact match is returned on page 0 instead of page -1. For example, 'Bacon, Jono.' becomes 'Bacon, Jono' for the search. (The right thing to do, come to think of it, is probably to naco_normalize the incoming value; perhaps next patch). git-svn-id: svn://svn.open-ils.org/ILS/trunk@19331 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm | 4 ++++ Open-ILS/xul/staff_client/server/cat/marcedit.js | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm b/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm index f88fd6ffaa..3a85a22c2b 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm @@ -1498,10 +1498,14 @@ sub authority_tag_sf_startwith { my $tag = shift; my $subfield = shift; + my $value = shift; my $limit = shift || 10; my $page = shift || 0; + # Chop the last character from the incoming value to return it on page 0 + chop($value); + my $ref_limit = $limit; my $offset = $limit * abs($page); my $_storage = OpenSRF::AppSession->create( 'open-ils.cstore' ); diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js index 2dfd226367..c231e9a344 100644 --- a/Open-ILS/xul/staff_client/server/cat/marcedit.js +++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js @@ -2375,7 +2375,8 @@ function browseAuthority (sf_popup, menu_id, target, sf, limit, page) { page = 0; } - var url = '/opac/extras/browse/marcxml/' + /* temporarily use 'startwith' instead of 'browse' until browse is repaired */ + var url = '/opac/extras/startwith/marcxml/' + type + '.refs' + '/1' // OU - currently unscoped + '/' + sf.toString() -- 2.11.0