Bug 18106

Summary: Batch-update bibliographic records when authorities are modified
Product: Koha Reporter: Claudio <costalc>
Component: MARC Authority data supportAssignee: Galen Charlton <gmcharlt>
Status: CLOSED DUPLICATE QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: katrin.fischer, m.de.rooy
Version: 16.11   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: .

Description Claudio 2017-02-13 21:12:15 UTC
Is there a way to batch-update bibliographic records when an authority record is modified? I mean with a cronjob (I guess dontmerge syspref is not the correct way)
Comment 1 Katrin Fischer 2017-02-13 21:22:27 UTC
I think that is exactly what dontmerge does - unless you modified it outside of Koha? 

dontmerge: [Do|Don't] automatically update attached biblios when changing an authority record. If this is off, please ask your administrator to enable the merge_authority.pl cronjob. 

The merge_authority.pl cronjob will be used if you don't want to do it immediately after changing the record (could be a performance hit I guess)
Comment 2 Claudio 2017-02-13 21:32:58 UTC
Katrin, happy to read you.

I want to use merge_authority.pl cronjob (because a performance issue) but it does not work as the manual or the syspref explain it. Would you please send me an example? I want to modified ALL bibliographic records in a batch mode. Which parameters must I add to merge_authority.pl? Because it asks for two...
Comment 3 Katrin Fischer 2017-02-13 21:38:39 UTC
We haven't used it so far - only the automatic way. But I think it takes information about what records to update from the need_merge_authorities table in the database usually.
Comment 4 Katrin Fischer 2017-02-13 21:39:14 UTC
Btw. this would be a better type of question for the mailing list, where lots more people read you and should not be a bug possibly at this state.
Comment 5 Claudio 2017-02-13 21:52:23 UTC
merge_authority.pl works merging two authority records. It does not update bibliographic records from an authority record recently modified. For example, we have an authority record linked to 1000 bibliographic records. If we modify the authority record and then run merge_authority.pl it fails. See file attached.
Comment 6 Claudio 2017-02-13 21:52:52 UTC
Created attachment 60165 [details]
.
Comment 7 Claudio 2017-02-13 21:56:39 UTC
By the way, dontmerge syspref is set to don't merge
Comment 8 Katrin Fischer 2017-02-13 22:06:56 UTC
I think it might be able to run it manually and without options to use the table. I don't fully understand the script. But there is a note:

42 All biblios with the authority in -t will be modified to be "connected" to authority -f

The change in the bilbiographic records could not happen in the script itself, but in one of the routines it calls. Hard to tell without further investigation.  I won't be able to look deeper into this.

Maybe check if changing an authority heading creates an entry in the table for a start.
Comment 9 Katrin Fischer 2017-02-13 22:08:59 UTC
Hm, found ModAuthority should be adding to the table:
http://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=C4/AuthoritiesMarc.pm;hb=2f64fd3918a205ac21630657160f61200c791320#l727
Comment 10 Claudio 2017-02-13 22:36:43 UTC
The merge_authority.pl cronjob is not for upgrading bibliographic records, but to merge authority ones. It seems there's no way to batch-update bibliographic records when an authority one is modified...

Thanks anyway Katrin!
Comment 11 Katrin Fischer 2017-02-13 22:57:18 UTC
Claudio, from the glances I took at the code, it looks differently to me. But you can also ask on the mailing list - someone there might be using the non-automatic verson of dontmerge.
Comment 12 Marcel de Rooy 2017-02-23 09:17:48 UTC
Claudio
There are several patches underway in this area.
dontmerge will be replaced by authoritymergelimit in bug 9988 (will submit that one this week)
a maintenance script will go on bug 18071
see all bugs related here on bug 17908 (omnibus)

*** This bug has been marked as a duplicate of bug 17908 ***
Comment 13 Claudio 2017-02-23 13:32:29 UTC
(In reply to Marcel de Rooy from comment #12)
> Claudio
> There are several patches underway in this area.
> dontmerge will be replaced by authoritymergelimit in bug 9988 (will submit
> that one this week)
> a maintenance script will go on bug 18071
> see all bugs related here on bug 17908 (omnibus)
> 
> *** This bug has been marked as a duplicate of bug 17908 ***

Thanks Marcel, I will pay close attention to your comment.