Bugzilla – Attachment 34992 Details for
Bug 13528
Ability to search on the different isbn variations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13528: Use the different isbn variations on search on the isbn index (nb)
Bug-13528-Use-the-different-isbn-variations-on-sea.patch (text/plain), 4.87 KB, created by
Jonathan Druart
on 2015-01-07 09:57:23 UTC
(
hide
)
Description:
Bug 13528: Use the different isbn variations on search on the isbn index (nb)
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-01-07 09:57:23 UTC
Size:
4.87 KB
patch
obsolete
>From 66fce1de924a1a59b8db30ef0b04e0fb68c7c229 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 22 Dec 2014 15:56:41 +0100 >Subject: [PATCH] Bug 13528: Use the different isbn variations on search on the > isbn index (nb) > >This enhancement adds the ability to search on all isbn variations when >searching on the isbn index. > >Test plan: >0/ Don't apply the patch >1/ Create or choose a notice with an isbn with dashes. >2/ Try to search the notice using the isbn index by it isbn without >dashes. >=> It does not work. >3/ Apply the patch, enable the new pref SearchWithISBNVariations and >disable UseQueryParser. >4/ repeat 2 and note that the record is now returned. > >Note that this only works if UseQueryParser is disabled. >It looks like QueryParser does not manage more than 1 operator. >See: > QueryParser does not manage more than 1 operator? > http://lists.koha-community.org/pipermail/koha-devel/2014-December/041028.html >and > commit 036f2a50e11dab97ef8509f2f585c4cc407ea728 > Author: Galen Charlton <gmc@esilibrary.com> > Date: Mon May 5 19:31:00 2014 +0000 > Bug 10500: (follow-up) disable AggressiveMatchOnISBN if > UseQueryParser is on >--- > C4/Search.pm | 7 +++++++ > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 10 ++++++++++ > .../prog/en/modules/admin/preferences/searching.pref | 7 +++++++ > 4 files changed, 25 insertions(+) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 1326f69..99557f8 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1570,6 +1570,13 @@ sub buildQuery { > $remove_stopwords > ) = ( 0, 0, 0, 0, 0 ); > >+ if ( $index eq 'nb' ) { >+ if ( C4::Context->preference("SearchWithISBNVariations") ) { >+ my @isbns = C4::Koha::GetVariationsOfISBN( $operand ); >+ $operands[$i] = $operand = '(nb=' . join(' OR nb=', @isbns) . ')'; >+ $indexes[$i] = $index = ''; >+ } >+ } > } > > if(not $index){ >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 89707ef..ab490ea 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -367,6 +367,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'), > ('SCOUserJS','',NULL,'Define custom javascript for inclusion in the SCO module','free'), > ('SearchMyLibraryFirst','0',NULL,'If ON, OPAC searches return results limited by the user\'s library by default if they are logged in','YesNo'), >+('SearchWithISBNVariations','0',NULL,'If enabled, search on all variations of the ISBN','YesNo'), > ('SelfCheckHelpMessage','','70|10','Enter HTML to include under the basic Web-based Self Checkout instructions on the Help page','Textarea'), > ('SelfCheckReceiptPrompt','1','NULL','If ON, print receipt dialog pops up when self checkout is finished','YesNo'), > ('SelfCheckTimeout','120','','Define the number of seconds before the Web-based Self Checkout times out a patron','Integer'), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index d2b03c3..c27d6ae 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -9656,6 +9656,16 @@ if(CheckVersion($DBversion)) { > SetVersion($DBversion); > } > >+$DBversion = "3.19.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do(q| >+ INSERT INTO systempreferences ( variable, value, options, explanation, type ) VALUES >+ ('SearchWithISBNVariations','0',NULL,'If enabled, search on all variations of the ISBN','YesNo') >+ |); >+ print "Upgrade to $DBversion done (Bug 13528 - Add the SearchWithISBNVariations syspref)\n"; >+ SetVersion ($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >index c6a19bf..8b04d39 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >@@ -214,3 +214,10 @@ Searching: > - Use the following text as separator for UNIMARC authors facets > - pref: UNIMARCAuthorsFacetsSeparator > class: short >+ - >+ - When searching on the ISBN index, >+ - pref: SearchWithISBNVariations >+ choices: >+ yes: "search" >+ no: "don't search" >+ - on all variations of the ISBN. Note that this preference has no effect if UseQueryParser is on. >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13528
:
34992
|
35290
|
35316
|
35335