Bugzilla – Attachment 59927 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: [Follow-up] Code cleaning
Bug-16018-Follow-up-Code-cleaning.patch (text/plain), 3.04 KB, created by
Marcel de Rooy
on 2017-02-06 13:15:46 UTC
(
hide
)
Description:
Bug 16018: [Follow-up] Code cleaning
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-02-06 13:15:46 UTC
Size:
3.04 KB
patch
obsolete
>From bab0ec16c131fc45eee11ad9a7f8697139cf9747 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 24 Jan 2017 14:53:33 +0100 >Subject: [PATCH] Bug 16018: [Follow-up] Code cleaning >Content-Type: text/plain; charset=utf-8 > >It is not useful to postpone a merge to the cron job here, since the >old authority record is deleted. (Note that bug 9988 will address this >subject too.) > >Removing the call to C4::ImportBatch::SetImportRecordStatus: Since >$recordid2 is not an import_record_id, this is useless and potentially wrong. >Removed the if statement for @errors, since it is not used at this point; >putting the result of a comparison into $error is not useful either. > >Note: there is a lot of code in merge.pl around breeding that is actually >unused. Template tools/manage-marc-import.tt contains two unused blocks >final_match_link and match_link that contain a (unreachable) call to >authorities/merge.pl with parameters: >mergereference=breeding&authid=[% record_lis.match_id %]&authid=[% record_lis.import_record_id %] >It seems that this would show the records correctly, but would not merge >them correctly since that code expects two authority records. > >Leaving the signoff of Mehdi since he essentially tested the merge call. > >Test plan: See first patch. > >Signed-off-by: mehdi <mehdi@inlibro.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Tested merging PERSO_NAME to PERSO_NAME and PERSO_NAME to CORPO_NAME. >--- > authorities/merge.pl | 26 +++++--------------------- > 1 file changed, 5 insertions(+), 21 deletions(-) > >diff --git a/authorities/merge.pl b/authorities/merge.pl >index 60bc6db..bef1bc5 100755 >--- a/authorities/merge.pl >+++ b/authorities/merge.pl >@@ -61,29 +61,13 @@ if ($merge) { > # 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 ) ); >- } >+ # Now merge for biblios attached to $recordid2 >+ # We ignore dontpref now, since recordid2 is deleted >+ my $MARCfrom = GetAuthority( $recordid2 ); >+ &merge( $recordid2, $MARCfrom, $recordid1, $record ); > > # Deleting the other record >- if ( scalar(@errors) == 0 ) { >- >- my $error; >- if ($input->param('mergereference') eq 'breeding') { >- require C4::ImportBatch; >- C4::ImportBatch::SetImportRecordStatus( $recordid2, 'imported' ); >- } else { >- C4::AuthoritiesMarc::merge( $recordid2, GetAuthority($recordid2), $recordid1, $record ); >- $error = (DelAuthority($recordid2) == 0); >- } >- push @errors, $error if ($error); >- } >+ DelAuthority( $recordid2 ); > > # Parameters > $template->param( >-- >2.1.4
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