For more predictable authority browse results, use startwith until browse is sorted out
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 29 Jan 2011 18:03:26 +0000 (18:03 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 29 Jan 2011 18:03:26 +0000 (18:03 +0000)
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
Open-ILS/xul/staff_client/server/cat/marcedit.js

index f88fd6f..3a85a22 100644 (file)
@@ -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' );
index 2dfd226..c231e9a 100644 (file)
@@ -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()