Bug 9341 - Problem with UNIMARC authors facets
Summary: Problem with UNIMARC authors facets
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P1 - high major
Assignee: Vitor Fernandes
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-03 11:43 UTC by Vitor Fernandes
Modified: 2014-05-26 21:04 UTC (History)
4 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 9341: Problem with UNIMARC authors facets (998 bytes, patch)
2013-01-03 11:52 UTC, Vitor Fernandes
Details | Diff | Splinter Review
Bug 9341: Problem with UNIMARC authors facets (3.71 KB, patch)
2013-01-04 13:09 UTC, Vitor Fernandes
Details | Diff | Splinter Review
Bug 9341: Problem with UNIMARC authors facets (1.04 KB, patch)
2013-01-07 12:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9341: Problem with UNIMARC authors facets (3.79 KB, patch)
2013-01-07 12:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9341: Problem with UNIMARC authors facets (3.64 KB, patch)
2013-02-18 10:43 UTC, Vitor Fernandes
Details | Diff | Splinter Review
Bug 9341: Problem with UNIMARC authors facets (3.85 KB, patch)
2013-03-18 16:21 UTC, Paul Poulain
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Vitor Fernandes 2013-01-03 11:43:49 UTC
Problem happens in Koha 3.8 but maybe it happens also in 3.10.

In UNIMARC installations the authors have a double comma separating the subfield a and the subfield b.

The problem is the following:

- UNIMARC authors are 7XX fields
- In UNIMARC 7XXa is always filled with the surname and a comma, like "SURNAME,"
- The facets are build with 700ab, 701ab and 702ab
- The facets use a comma to separate the subfield a and subfield b, so there a double comma: the separator and the comma from subfield a

Solution:

Change the method getFacets of Koha.pm - separator for UNIMARC authors will be a space instead of a comma.
Comment 1 Vitor Fernandes 2013-01-03 11:52:11 UTC Comment hidden (obsolete)
Comment 2 Mathieu Saby 2013-01-03 13:14:36 UTC
Hello
In France we don't add any ponctuation in 7XX$a, so I was surprised.
But, you are right, except it is only a recommandation, and not a part of the format itself.

The UNIMARC manual (2008) says :
"There are no standards for punctuation in this field. However, it is recommended that punctuation be retained where it is available in the source format. In source formats where punctuation is not available, but is printed out by an algorithm generated from the definition of the subfields, it is recommended that the punctuation which would be used in display be included in the UNIMARC record.
Because there are no standards for punctuation in this field, recipients of records in the UNIMARC format will have to be aware of the practices adopted by the agency preparing the record; therefore agencies distributing records should attempt to be consistent in their own records."

But in French version of the manual, http://www.bnf.fr/documents/B700-6-2010.pdf
we read :
"NdT : les exemples provenant de catalogues anglo-saxons contiennent la ponctuation prescrite, qui a été saisie et non pas générée par programme comme le veut l’usage français."

(Translator note : examples from anglo-saxon catalogs contains punctuation, included in the record, and not generated by an algorithm as wants french use)

So maybe it should be a syspref ?

M. Saby
Comment 3 Vitor Fernandes 2013-01-04 12:48:39 UTC
Hi Mathieu,

You're right. I've checked out this with some librarians and there isn't a rule for the filling of UNIMARC authors.
So this should be a preference.

I will do the change today.
Comment 4 Vitor Fernandes 2013-01-04 13:09:04 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2013-01-04 15:19:11 UTC
Hi Vitor,

your patch does not apply:

Applying: Bug 9341: Problem with UNIMARC authors facets
fatal: sha1 information is lacking or useless (C4/Koha.pm).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.

Could your reformat and resubmit it please?
Comment 6 Vitor Fernandes 2013-01-04 16:15:19 UTC
Hi Jonathan,

I don't see any problem with the patch.
What could be wrong?

C4/Koha.pm only has one simple change that worked in my installation.
Comment 7 Vitor Fernandes 2013-01-04 16:16:45 UTC
Jonathan,

Can you try now?
I was because I put the first patch obsolete.
Comment 8 Jonathan Druart 2013-01-07 10:29:26 UTC
QA Comment:

I agree with the syspref but I think the default value should be the comma in order not to change the current behavior.
Why do you create a specific syspref for UNIMARC? We could create a syspref named AuthorsFacetsSeparator and use it for other formats too.

Marked as Failed QA.
Comment 9 Vitor Fernandes 2013-01-07 10:42:58 UTC
Jonathan,

The default value is ', ', like it was now.
Check the MySQL insert in the updatedatabase.pl.
The problem only happens in UNIMARC, and that's in MARC21 the authors are only listed in 100a, 110a and 700a. So the separator is never used.
Comment 10 Jonathan Druart 2013-01-07 12:50:53 UTC
(In reply to comment #9)
> Jonathan,
> 
> The default value is ', ', like it was now.

Yes, you are right.

> Check the MySQL insert in the updatedatabase.pl.
> The problem only happens in UNIMARC, and that's in MARC21 the authors are
> only listed in 100a, 110a and 700a. So the separator is never used.

Yep, ok
Comment 11 Jonathan Druart 2013-01-07 12:51:58 UTC Comment hidden (obsolete)
Comment 12 Jonathan Druart 2013-01-07 12:52:42 UTC Comment hidden (obsolete)
Comment 13 Katrin Fischer 2013-02-17 22:08:50 UTC
Hi Vitor,
I am sorry, but I can't get the second patch to apply, with or without the first patch:

Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all y
Applying: Bug 9341: Problem with UNIMARC authors facets
fatal: sha1 information is lacking or useless (C4/Koha.pm).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Bug 9341: Problem with UNIMARC authors facets
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".

Can you please rebase and resubmit? If you can rebase without bigger problems (updatedatabase etc. is ok) switch back to Signed off.
Comment 14 Vitor Fernandes 2013-02-18 10:43:26 UTC Comment hidden (obsolete)
Comment 15 Paul Poulain 2013-03-18 16:21:19 UTC
Created attachment 16279 [details] [review]
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 <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Comment 16 Paul Poulain 2013-03-18 16:22:13 UTC
QA comments: 
 * passes koha-qa.pl
 * default behaviour unchanged, new behaviour driven by a (needed) syspref

passed QA
Comment 17 Jared Camins-Esakov 2013-03-20 00:46:11 UTC
This patch has been pushed to master.
Comment 18 Chris Cormack 2013-03-29 06:12:02 UTC
Pushed to 3.10.x and 3.8.x will be in 3.10.5 and 3.8.12