From 5c57f0d0a5490fc318c04b22183ed32b6e537c49 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 --- C4/Koha.pm | 2 +- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 6 ++++++ .../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 db71fe7..4c01309 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 e3966ce..8f8f67b 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 f0a9269..ba02d99 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 2b1848f..29da64e 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 -- 1.7.9.5