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)
Created attachment 10453 [details] [review] Bug 8304 : composed authorities Rameau management Bug 5635: bulkmarcimport new parameters & features 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)
Created attachment 11046 [details] [review] Bug 8304 : composed authorities Rameau management Bug 5635: bulkmarcimport new parameters & features 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)
This new patch removes the reindenting changes, making the patch easier to read and to understand.
Created attachment 12081 [details] [review] Bug 8304 : composed authorities Rameau management Bug 5635: bulkmarcimport new parameters & features 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) Rebased patch
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.
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.
Created attachment 14112 [details] [review] Bug 8304 : composed authorities Rameau management Bug 5635: bulkmarcimport new parameters & features 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)
(Rebased patch)
Created attachment 14308 [details] biblio record This file contains UNIMARC bibliorecords as example
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.
Created attachment 14564 [details] [review] New version for patch Introduces two new fields in need_merge
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".
The syspref "dontmerge" wasn't activated ^^ I've made a little modification, and it's ok.
Patch tested with a sandbox, by Pierre Angot <tredok.pierre@gmail.com>
Created attachment 15849 [details] [review] Bug 8304 : composed authorities Rameau management Bug 5635: bulkmarcimport new parameters & features 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) Signed-off-by: Pierre Angot <tredok.pierre@gmail.com>
Created attachment 16784 [details] [review] Bug 8304 : composed authorities Rameau management patch rebased on master due to Bug 5635 integration. Basic rebase, keeping signed-off
Created attachment 16790 [details] [review] Bug 8304 : composed authorities Rameau management fix bad POD already present before this commit. 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>
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.
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>
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.
Created attachment 18450 [details] [review] Bug 8304: UT for new subroutines
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.
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
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.
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 ***