Bug 8304 - composed authorities Rameau management
Summary: composed authorities Rameau management
Status: RESOLVED DUPLICATE of bug 14560
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Authority data support (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Matthias Meusburger
QA Contact:
URL:
Keywords:
Depends on: 10298
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-25 07:20 UTC by Matthias Meusburger
Modified: 2015-09-29 12:30 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Medium patch
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 8304 : composed authorities Rameau management (32.25 KB, patch)
2012-06-25 07:22 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 8304 : composed authorities Rameau management (29.43 KB, patch)
2012-07-20 14:14 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 8304 : composed authorities Rameau management (29.89 KB, patch)
2012-09-09 12:25 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Bug 8304 : composed authorities Rameau management (28.65 KB, patch)
2012-12-14 09:36 UTC, Matthias Meusburger
Details | Diff | Splinter Review
biblio record (73.83 KB, application/octet-stream)
2012-12-28 11:02 UTC, laurenthdl
Details
authorities linked to biblio records (6.85 KB, image/x-panasonic-raw)
2012-12-28 11:04 UTC, laurenthdl
Details
New version for patch Introduces two new fields in need_merge (42.95 KB, patch)
2013-01-14 13:35 UTC, laurenthdl
Details | Diff | Splinter Review
Bug 8304 : composed authorities Rameau management (43.04 KB, patch)
2013-03-04 15:10 UTC, Paul Poulain
Details | Diff | Splinter Review
Bug 8304 : composed authorities Rameau management (28.45 KB, patch)
2013-03-22 13:33 UTC, Stéphane Delaune
Details | Diff | Splinter Review
Bug 8304 : composed authorities Rameau management (28.78 KB, patch)
2013-03-22 13:59 UTC, Stéphane Delaune
Details | Diff | Splinter Review
Bug 8304 : composed authorities Rameau management (28.91 KB, patch)
2013-05-23 07:36 UTC, Paul Poulain
Details | Diff | Splinter Review
Bug 8304: UT for new subroutines (3.05 KB, patch)
2013-05-29 08:42 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Meusburger 2012-06-25 07:20:14 UTC
This patch is designed to manage the composed authorities the Way Rameau is coping with them in France.
This enables libraries to merge composed authorities and only change the heading field.
It supposes that the previous data is sent to merge function so that process deletes previous heading entries.

Say you have in a biblio record :
   - 606
       $9 1214
       $3 123
       $a Europe
       $9 1215
       $3 456
       $y France
       $9 1210
       $3 199
       $x Politiciens
       $9 1216
       $3 789
       $z 1801-1860
And you change authority 1210
    -250
        $a Politiciens
into
    -250
        $a Politique

You should get :
   - 606
       $9 1214
       $3 123
       $a Europe
       $9 1215
       $3 456
       $y France
       $9 1210
       $3 199
       $x Politique
       $9 1216
       $3 789
       $z 1801-1860

In an other record :
   - 606
       $9 1210
       $3 199
       $a Politiciens
You should get :
   - 606
       $9 1210
       $3 199
       $a Politique

This patch changes the merge function.
And adds three internal functions.
merge function  has been prettyfied
And documentation from GuessAuthTypeCode has been updated (had not been)
Comment 1 Matthias Meusburger 2012-06-25 07:22:13 UTC Comment hidden (obsolete)
Comment 2 Matthias Meusburger 2012-07-20 14:14:09 UTC Comment hidden (obsolete)
Comment 3 Matthias Meusburger 2012-07-20 14:15:08 UTC
This new patch removes the reindenting changes, making the patch easier to read and to understand.
Comment 4 Jared Camins-Esakov 2012-09-09 12:25:31 UTC Comment hidden (obsolete)
Comment 5 Jared Camins-Esakov 2012-09-09 12:30:39 UTC
While this feature is very promising, it does not cope well with multiple subfield authorities. If I change an authority with the following main entry:
=150 ##$aActors$zUnited States$vBiography

to
=150 ##$aActors$zUnited States$vBiographies

the bib records end up with the heading:
=650 ##$zUnited States$aActors$zUnited States$vBiographies

Notice the extra $z at the front.

Also, I noticed if your single-subfield heading is out of sync on the bib record, sometimes you end up with two identical subfields in the bib record. I'm not entirely sure what causes that, though, as it doesn't seem to happen 100% of the time.

Also note that in order to test this you must first apply the fix for bug 8743.
Comment 6 Jared Camins-Esakov 2012-09-09 12:49:28 UTC
If you added a syspref so that libraries using precomposed headings could disable the automatic composition, that would probably be enough for MARC21/NORMARC authority merging to resume working.
Comment 7 Matthias Meusburger 2012-12-14 09:36:02 UTC Comment hidden (obsolete)
Comment 8 Matthias Meusburger 2012-12-14 09:36:58 UTC
(Rebased patch)
Comment 9 laurenthdl 2012-12-28 11:02:15 UTC
Created attachment 14308 [details]
biblio record

This file contains UNIMARC bibliorecords as example
Comment 10 laurenthdl 2012-12-28 11:04:30 UTC
Created attachment 14309 [details]
authorities linked to biblio records

Beware that when importing, the authorities ids may change.
So you may have to change the related imported records.
Comment 11 laurenthdl 2013-01-14 13:35:06 UTC Comment hidden (obsolete)
Comment 12 Pierre Angot 2013-03-01 18:13:28 UTC
Hello,

I've tested with files added by Henri-Damien on sandbox (http://pro.pelardon.biblibre.com test/test)

- search authorities "Littérature sentimentale", edit it and modify 250$a (Harlequin champion de l'amour)
- search catalog "100 romans d'amour"
- check 606
- No change : 606$a is still "Littérature sentimentale".
Comment 13 Pierre Angot 2013-03-04 15:08:56 UTC
The syspref "dontmerge" wasn't activated ^^

I've made a little modification, and it's ok.
Comment 14 Paul Poulain 2013-03-04 15:10:12 UTC
Patch tested with a sandbox, by Pierre Angot <tredok.pierre@gmail.com>
Comment 15 Paul Poulain 2013-03-04 15:10:42 UTC Comment hidden (obsolete)
Comment 16 Stéphane Delaune 2013-03-22 13:33:50 UTC Comment hidden (obsolete)
Comment 17 Stéphane Delaune 2013-03-22 13:59:07 UTC Comment hidden (obsolete)
Comment 18 Pierre Angot 2013-05-23 07:35:46 UTC
I've tested on sandbox :

- search authorities "Poésie", edit it and modify 250$a (Poésie jolie)
- search catalog "Le buveur d'étoiles"
- check 606

- search authorities "Romain", edit it and modify 250$a (Romain test)
- search catalog "Au temps des romains"
- check 606

Everything is ok.
Comment 19 Paul Poulain 2013-05-23 07:36:19 UTC
Patch tested with a sandbox, by Pierre Angot <tredok.pierre@gmail.com>
Comment 20 Paul Poulain 2013-05-23 07:36:44 UTC
Created attachment 18325 [details] [review]
Bug 8304 : composed authorities Rameau management

This patch is designed to manage the composed authorities the Way Rameau is coping with them in France.
It supposes that the previous data is sent to merge function so that process deletes previous heading entries.

Say you have in a biblio record :
   - 606
       $9 1214
       $3 123
       $a Europe
       $9 1215
       $3 456
       $y France
       $9 1210
       $3 199
       $x Politiciens
       $9 1216
       $3 789
       $z 1801-1860
And you change authority 1210
    -250
        $a Politiciens
into
    -250
        $a Politique

You should get :
   - 606
       $9 1214
       $3 123
       $a Europe
       $9 1215
       $3 456
       $y France
       $9 1210
       $3 199
       $x Politique
       $9 1216
       $3 789
       $z 1801-1860

In an other record :
   - 606
       $9 1210
       $3 199
       $a Politiciens
You should get :
   - 606
       $9 1210
       $3 199
       $a Politique

This patch changes the merge function.
Signed-off-by: Pierre Angot <tredok.pierre@gmail.com>
Comment 21 Jonathan Druart 2013-05-29 08:40:11 UTC
QA comment:

1/ There is no unit tests for new subroutines introduced in C4::Charset and C4::AuthoritiesMarc packages.

2/ There is no call to C4::Charset::SanitizeEntity, where it is used?

3/ The C4::AuthoritiesMarc::_process_subfcode_4_merge checks if a string exists: q{S'emploie uniquement en subdivision chronologique} but there is no comment to explain what is it.

Marked as Failed QA.
Comment 22 Jonathan Druart 2013-05-29 08:42:05 UTC
Created attachment 18450 [details] [review]
Bug 8304: UT for new subroutines
Comment 23 Jonathan Druart 2013-05-29 08:42:34 UTC
3 unit tests in t/Charset do not pass, I think there is a bug in C4::Charset::SanitizeEntity.
I cannot provide unit tests for the C4::AuthoritiesMarc::_process_subfcode_4_merge routine, I don't understand what it does.
Comment 24 mathieu saby 2013-05-29 10:15:25 UTC
I don't know what _process_subfcode_4_merge does, but it is only dealing with some fields (600, 606, 607, 700, 701, 710, 711, 712).
Maybe it should deal other subject fields (like 604, 605, 608, 616) ?

M. Saby
Comment 25 Fridolin Somers 2014-12-03 16:02:48 UTC
The patch adds in merge() :
+    DelAuthority($mergefrom) if ( $mergefrom != $mergeto );

This is a big difference and I think is not necessary because codes calling merge() call this method when necessary.
Comment 26 claire.hernandez@biblibre.com 2015-09-29 12:30:18 UTC
Has been replaced by http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14560

*** This bug has been marked as a duplicate of bug 14560 ***