[Koha-bugs] [Bug 1807] search () give odd results

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Oct 23 16:43:15 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=1807

Christopher Brannon <cbrannon at cdalibrary.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cbrannon at cdalibrary.org

--- Comment #9 from Christopher Brannon <cbrannon at cdalibrary.org> ---
(In reply to Jesse Maseto from comment #8)
> 
> //Fix subject search by striping parenthesis from url links
> $('#catalogue_detail_biblio a[href*="su:"]').attr('href', function(_,v){
> return v.replace(/(\(|\))/g,'')
> });
> 
> This works for both the staff search and OPAC.

Actually had to update this jquery to catch more.  Simply striping the
parenthesis isn't enough, because sometimes it will mash words together.  And
sometimes replacing it with a space throws off the search as well.  This
modification seems to work better at fixing the issue:

//Fix subject search by striping parenthesis from url links
$('#catalogue_detail_biblio a[href*="su:"]').attr('href', function(_,v){
    return v.replace(/(\w)(\(|\))(\w)/g,'$1 $3')
}).attr('href', function(_,v){
    return v.replace(/(\(|\))/g,'')
});
//End fix subject search

I don't know if it addresses all situations, but I've been tweaking it as I
come across new situations.

Christopher

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list