When importing authorities through bulkmarcimport with the -match option, there are 3 possibilities: 1) An existing authority has been found in koha according to the -match criteria. The authority is replaced if needed (005 are checked first). This is ok. 2) No authority is found in koha according to the -match criteria. The authority is inserted. This is also ok. 3) Multiple authorities have been found in koha according to the -match criteria. The authority is inserted. => Is this the expected behavior? As the -match criteria is used for deduping, the existing authorities are very likely to be already existing duplicates. Do we really want to add another one? My feeling is that in this case, the authority should NOT be inserted. Can I have your opinion on this?
Created attachment 61106 [details] [review] Bug 18273: Do not insert authority if there already are duplicates in koha
The bibliographic import overlays the one with the lower (or higher?) biblionumber. Not sure if we should make it consistent.
Are you sure about that Katrin? From what I've seen, the behaviour is the same for biblios: if multiple matching biblios have been found, a new biblio is inserted.
Hm, I was pretty sure, but was thinking of the staged marc tool. Didn't realize then it will probably be different for bulkmarcimport. Makes sense then.
Need signoff ?
Needs an easy rebase
Hi, it would be nice to have a follow-up on this one. Thx Sonia
Created attachment 144213 [details] [review] Bug 18273: Do not insert authority if there already are duplicates in koha
I think I managed to successfully rebase this one, but I'm not sure how to test. If we could get a test plan, I'll have a go at testing. It would be great if the test plan could include: - the bulkmarcimport command to use, and - authority record samples to use to test the scenarios outlined in the bug description (or how to create).
Patch still applies, but is missing a test plan. I think some hints, especially on the CLI parameters to use with bulkmarcimport could help to get this further.
Created attachment 171385 [details] [review] Bug 18273: Do not insert authority if there already are duplicates in koha Test plan: 1) Create an authority with a unique value in a searchable field, for instance a PERSO_NAME authority with 'BZ18273' in the 100$a field. 2) Create a second authority with the same value in the same field. 3) Export this second authority as iso2709 (Save -> MARC (Unicode/UTF-8)) 4) Run bulkmarcimport.pl with the following parameters: perl bulkmarcimport.pl -a --file=/kohadevbox/koha/auth-xxxx.utf8 --match='Heading,100$a' -l /kohadevbox/koha/bulk.log 5) Check in the log file and/or through search that a third authority has been added (despite using the --match option) 6) Apply the patch 7) Delete the 3 authorities and repeat step 1 to 4. 8) Check that a third authority has not been added (--match worked)
Hi, I've added a test plan.
Created attachment 172049 [details] [review] Bug 18273: Do not insert authority if there already are duplicates in koha Test plan: 1) Create an authority with a unique value in a searchable field, for instance a PERSO_NAME authority with 'BZ18273' in the 100$a field. 2) Create a second authority with the same value in the same field. 3) Export this second authority as iso2709 (Save -> MARC (Unicode/UTF-8)) 4) Run bulkmarcimport.pl with the following parameters: perl bulkmarcimport.pl -a --file=/kohadevbox/koha/auth-xxxx.utf8 --match='Heading,100$a' -l /kohadevbox/koha/bulk.log 5) Check in the log file and/or through search that a third authority has been added (despite using the --match option) 6) Apply the patch 7) Delete the 3 authorities and repeat step 1 to 4. 8) Check that a third authority has not been added (--match worked) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Thanks Matts, Super trivial patch working as I'd expect. Passing QA