Bugzilla – Attachment 59531 Details for
Bug 16018
Merge.pl code cleanup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16018: Merge.pl does not update biblios linked to the old authority
Bug-16018-Mergepl-does-not-update-biblios-linked-t.patch (text/plain), 3.57 KB, created by
Mehdi Hamidi
on 2017-01-24 22:41:00 UTC
(
hide
)
Description:
Bug 16018: Merge.pl does not update biblios linked to the old authority
Filename:
MIME Type:
Creator:
Mehdi Hamidi
Created:
2017-01-24 22:41:00 UTC
Size:
3.57 KB
patch
obsolete
>From 92a0bbf9ef305682ef9a46c5152e1a3b4d4bde33 Mon Sep 17 00:00:00 2001 >From: remi <remi.mayrand-provencher@inLibro.com> >Date: Wed, 9 Mar 2016 11:48:31 -0500 >Subject: [PATCH] Bug 16018: Merge.pl does not update biblios linked to the old > authority > >Original patch from Remi Mayrand-Provencher. >Amended by Marcel de Rooy (January 2017), part of omnibus bug 17908. > >EDIT: >We cannot remove the ModAuthority call, since the reference record is >the result of the merge and should be saved. >Variable $overwrite is not used and can be removed. > >The ModAuthority call triggers a merge like: recordid1, original ref record, >recordid1, new ref record. This only updates all biblio records that were >already attached to the reference record. >As Remi discovered correctly, we still need another merge for the biblios >attached to recordid2 (the record to be deleted). >This patch adds that merge. > >Note: The results of this merge operation should have been improved by the >changes to C4::AuthoritiesMarc::merge. > >Test plan: >[1] Restart Plack and restart koha-indexer. (I had some problems related to > indexing as a result of the marcxml transition.) >[2] Go to Authorities. > Select two authorities to merge, start with two of the same type. > Make sure that both are used in a few biblio records. > Select at least one subfield from the authority to be removed for > inclusion in the authority to be kept ("reference record"). >[3] Click Merge. You come back to the kept authority record. > Note: The number of attached records may not yet be updated. This depends > on the speed of koha-indexer. If you wait a bit and refresh, you should > have the correct number. > First check the authority record again for the inserted subfield. > Now check a biblio that was ALREADY attached to the reference record. > And check a biblio that was FORMERLY attached to the deleted one. > Note: See bug 17913 to see how pref AuthorityMergeMode impacts this. >[4] Try steps 2 and 3 again for a merge of two authority records that do not > have the same authority type noting the remarks below. > For instance try to merge from a CORPO_NAME to a PERSO_NAME record. > Make a change in say 040$a of the record to be deleted. And select that > field later on the merge form. > Normally, you would use the PERSO_NAME framework in the merge now. > When checking the authority record, look at 040a. When checking the > record that was linked to the CORPO_NAME, check if it contains the > PERSO_NAME authority in the correct field (say 100, 600, 700). > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: mehdi <mehdi@inlibro.com> >--- > authorities/merge.pl | 11 +++++++++++ > 1 file changed, 11 insertions(+) > >diff --git a/authorities/merge.pl b/authorities/merge.pl >index b423122..60bc6db 100755 >--- a/authorities/merge.pl >+++ b/authorities/merge.pl >@@ -58,8 +58,19 @@ if ($merge) { > $record->leader( GetAuthority($recordid1)->leader() ); > > # Modifying the reference record >+ # This triggers a merge for the biblios attached to $recordid1 > ModAuthority( $recordid1, $record, $typecode ); > >+ # We still need a merge for biblios attached to $recordid2 >+ if( C4::Context->preference('dontmerge') ne '1' ) { >+ my $MARCfrom = GetAuthority( $recordid2 ); >+ &merge( $recordid2, $MARCfrom, $recordid1, $record ); >+ } else { >+ my $dbh = C4::Context->dbh; >+ my $sqlinsert = "INSERT INTO need_merge_authorities (authid, done) VALUES (?,?)"; >+ $dbh->do( $sqlinsert, undef, ( $recordid1, 0 ) ); >+ } >+ > # Deleting the other record > if ( scalar(@errors) == 0 ) { > >-- >1.9.1
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 16018
:
48889
|
58578
|
59497
|
59502
|
59531
|
59532
|
59547
|
59927
|
59930
|
59935