From 6646c5887a02563f421bd239c5f004efa7ee847a 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 --- C4/Koha.pm | 2 +- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 6 ++++++ .../prog/en/modules/admin/preferences/searching.pref | 4 ++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index db71fe789e..4c01309263 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 e3966ce230..8f8f67b9c6 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -421,3 +421,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES( INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('PatronSelfRegistrationAdditionalInstructions','','A free text field to display additional instructions to newly self registered patrons.','','free'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UseQueryParser', '0', 'If enabled, try to use QueryParser for queries.', NULL, 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('FinesIncludeGracePeriod','1','If enabled, fines calculations will include the grace period.',NULL,'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 f0a926961e..ba02d99ad7 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6531,6 +6531,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { print "Upgrade to $DBversion done (3.12-alpha release)\n"; SetVersion ($DBversion); } +$DBversion = "3.11.00.XXX"; +if ( CheckVersion($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 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 2b1848f74c..29da64eae2 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 @@ -183,3 +183,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