From cd173ef3fd2b35eeb64a2a4943156ce918761c06 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 Conflicts: installer/data/mysql/sysprefs.sql Signed-off-by: Chris Cormack --- C4/Koha.pm | 2 +- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../prog/en/modules/admin/preferences/searching.pref | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index 73cddb4975..ff524822b0 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -701,7 +701,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 132bbbe79f..141cf5af6b 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -365,3 +365,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SuspendHoldsIntranet', '1', NULL , 'Allow holds to be suspended from the intranet.', 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SuspendHoldsOpac', '1', NULL , 'Allow holds to be suspended from the OPAC.', '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 063f7563f7..86d97614e8 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5331,6 +5331,13 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.08.11.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 5176d520b3..c01af7b4ee 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 @@ -172,3 +172,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