Bugzilla – Attachment 69344 Details for
Bug 19693
Update of an authority record creates inconsistency when the heading tag is changed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19693: authtypefrom incorrectly set when updating auth from file
0001-Bug-19693-authtypefrom-incorrectly-set-when-updating.patch (text/plain), 2.78 KB, created by
Janusz Kaczmarek
on 2017-11-25 00:42:57 UTC
(
hide
)
Description:
Bug 19693: authtypefrom incorrectly set when updating auth from file
Filename:
MIME Type:
Creator:
Janusz Kaczmarek
Created:
2017-11-25 00:42:57 UTC
Size:
2.78 KB
patch
obsolete
>From 1339187904befec519fa3bf27a70f44f709749ac Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Sat, 25 Nov 2017 00:25:46 +0100 >Subject: [PATCH] Bug 19693: authtypefrom incorrectly set when updating auth > from file > >In those cases when authorities are updated by an external agency (or >even internally, by reviewing and correcting an exported authority file) >when the heading tag will be changed (seems odd but happens: > >111 Congress ==> 110 Corporate body.Congress ; >100 Person ==> 110 Corporate body (a company named with person's name ; >151 City--object ==> 150 Object (city) etc.) > >and then the authority record in Koha database will be updated with >bulkmarcimport or by calling directly ModAuthority from a custom script, >the merge function "doesn't know" that the change to the authority type >has been made and, consequently, doesn't adequately change the tag in >related fields in biblio records (as it would if two different records >with different authtypecode were merged with Koha interface). > >This is because at the moment when merge function is being called >by ModAuthority >Koha::Authority::Types->find($autfrom->authtypecode) >Koha::Authority::Types->find($authto->authtypecode) >both have the same value (because $autfrom == $autfrom). > >Therefore the authtype guessed from the old version of the record should >be considered. > >To test: >1) have an authority record used in biblio; > export it to file; > change 1XX heading tag to different (but reasonable) value > and possibly change also the content of the heading > (one can delete also 942 but it doesn't matter); > make bulkmarcimport.pl -a -update -file <modified_auth_file> and > see that the tag in biblio record has not been changed (whereas > the type of authority record did change); > >2) make orders in database (so that the authority type and the tag of >the field in biblio record correspond); apply the patch; > >3) repeat the test from 1). >--- > C4/AuthoritiesMarc.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 6dbe516208..a18b4eea6a 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -1405,7 +1405,7 @@ sub merge { > # Search authtypes and reporting tags > my $authfrom = Koha::Authorities->find($mergefrom); > my $authto = Koha::Authorities->find($mergeto); >- my $authtypefrom = $authfrom ? Koha::Authority::Types->find($authfrom->authtypecode) : undef; >+ my $authtypefrom = $MARCfrom ? Koha::Authority::Types->find(GuessAuthTypeCode($MARCfrom)) : undef; > my $authtypeto = $authto ? Koha::Authority::Types->find($authto->authtypecode) : undef; > my $auth_tag_to_report_from = $authtypefrom ? $authtypefrom->auth_tag_to_report : ''; > my $auth_tag_to_report_to = $authtypeto ? $authtypeto->auth_tag_to_report : ''; >-- >2.11.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19693
:
69344
|
69349
|
69350
|
138121
|
138122
|
140915
|
140916
|
141480
|
141481
|
141482