From 01a122dbdcf17bf7847c998757461afba5ea45d2 Mon Sep 17 00:00:00 2001 From: Vitor FERNANDES Date: Mon, 18 Feb 2013 10:42:10 +0000 Subject: [PATCH] Bug 9341: Problem with UNIMARC authors facets In UNIMARC installations the authors have a double comma separating the subfield a and the subfield b. Test plan: - After applying the patch do a search and check the double comma in authors facets. - Apply the patch - Do a new search - Check if authors facets as a double comma Sponsored-by: KEEP SOLUTIONS Signed-off-by: Jonathan Druart Signed-off-by: Paul Poulain Signed-off-by: Jared Camins-Esakov Conflicts: installer/data/mysql/sysprefs.sql installer/data/mysql/updatedatabase.pl Signed-off-by: Chris Cormack --- C4/Koha.pm | 2 +- installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 7 +++++++ .../prog/en/modules/admin/preferences/searching.pref | 4 ++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index fbb90681a2..e78910efdf 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -708,7 +708,7 @@ sub getFacets { idx => 'au', label => 'Authors', tags => [ qw/ 700ab 701ab 702ab / ], - sep => ', ', + sep => C4::Context->preference("UNIMARCAuthorsFacetsSeparator"), }, { idx => 'se', diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 4d8c612f98..af1d85fcf9 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -389,4 +389,4 @@ INSERT INTO systempreferences (variable, value, options, explanation, type) VALU INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer'); INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('OPACNumbersPreferPhrase','0', NULL, 'Control the use of phr operator in callnumber and standard number OPAC searches', 'YesNo'); INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('IntranetNumbersPreferPhrase','0', NULL, 'Control the use of phr operator in callnumber and standard number staff client searches', 'YesNo'); - +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('UNIMARCAuthorsFacetsSeparator',', ', 'UNIMARC authors facets separator', NULL, 'short'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index c47cd3bebd..fe98f1db1b 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6174,6 +6174,13 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.10.04.001"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('UNIMARCAuthorsFacetsSeparator',', ', 'UNIMARC authors facets separator', NULL, 'short')"); + print "Upgrade to $DBversion done (Bug 9341: Problem with UNIMARC authors facets)\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 451cbc95c7..3a36b03acf 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 @@ -176,3 +176,7 @@ Searching: - pref: FacetLabelTruncationLength class: integer - characters, in OPAC/staff interface. + - + - Use the following text as separator for UNIMARC authors facets + - pref: UNIMARCAuthorsFacetsSeparator + class: short -- 2.39.5