From 665af0de599f9ac84ccf246a122794481340f874 Mon Sep 17 00:00:00 2001 From: Vitor FERNANDES Date: Fri, 4 Jan 2013 13:07:40 +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 --- C4/Koha.pm | 2 +- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 8 ++++++++ .../en/modules/admin/preferences/searching.pref | 5 +++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index b6a8a8c..3109222 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -706,7 +706,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 ab140e7..70e4a95 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -399,3 +399,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings', 'homebranch|holdingbranch', 'Choice'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings (OPAC)', 'homebranch|holdingbranch', 'Choice'); +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 2c4b1ed..53a53de 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6298,6 +6298,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.11.00.XXX"; +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 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 7b99173..604c542 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 @@ -160,3 +160,8 @@ 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