Bug 9341: Problem with UNIMARC authors facets
authorVitor FERNANDES <vfernandes@keep.pt>
Mon, 18 Feb 2013 10:42:10 +0000 (10:42 +0000)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Wed, 20 Mar 2013 00:37:29 +0000 (20:37 -0400)
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 <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

C4/Koha.pm
installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref

index db71fe7..4c01309 100644 (file)
@@ -708,7 +708,7 @@ sub getFacets {
                 idx   => 'au',
                 label => 'Authors',
                 tags  => [ qw/ 700ab 701ab 702ab / ],
-                sep   => ', ',
+                sep   => C4::Context->preference("UNIMARCAuthorsFacetsSeparator"),
             },
             {
                 idx   => 'se',
index e3966ce..8f8f67b 100644 (file)
@@ -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');
index f0a9269..ba02d99 100755 (executable)
@@ -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
 
index 2b1848f..29da64e 100644 (file)
@@ -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