Bugzilla – Attachment 28177 Details for
Bug 11700
C4::AuthoritiesMarc::merge enhancements/fixes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11700: Avoid to try to delete the authority twice
Bug-11700-Avoid-to-try-to-delete-the-authority-twi.patch (text/plain), 1.74 KB, created by
Jonathan Druart
on 2014-05-12 11:59:29 UTC
(
hide
)
Description:
Bug 11700: Avoid to try to delete the authority twice
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-05-12 11:59:29 UTC
Size:
1.74 KB
patch
obsolete
>From 04ce4487471837b43b0ae7155633048e52198d40 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 12 May 2014 13:47:44 +0200 >Subject: [PATCH] Bug 11700: Avoid to try to delete the authority twice > >--- > C4/AuthoritiesMarc.pm | 6 +++++- > authorities/merge.pl | 8 ++++---- > 2 files changed, 9 insertions(+), 5 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index ec5e615..793acea 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -1551,7 +1551,11 @@ sub merge { > } > }#foreach $marc > >- DelAuthority($mergefrom) if ($mergefrom != $mergeto); >+ if ( $mergefrom != $mergeto ) { >+ my $number_of_authorities_deleted = DelAuthority($mergefrom); >+ die "Authority $mergefrom has not been deleted" >+ if $number_of_authorities_deleted == 0; >+ } > > return @editedbiblios; > } >diff --git a/authorities/merge.pl b/authorities/merge.pl >index 3628381..5fe9382 100755 >--- a/authorities/merge.pl >+++ b/authorities/merge.pl >@@ -63,15 +63,15 @@ if ($merge) { > # 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); >+ eval { >+ C4::AuthoritiesMarc::merge( $recordid2, GetAuthority($recordid2), $recordid1, $record ); >+ }; >+ push @errors, 1 if $@; > } >- push @errors, $error if ($error); > } > > # Parameters >-- >1.7.10.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 11700
:
25086
|
25413
|
25414
|
25426
|
27970
|
27971
|
27972
|
27973
|
28176
|
28177
|
35107
|
39264
|
39265
|
39266
|
39267
|
39268
|
39269
|
40968
|
40969
|
40970
|
40971
|
40972
|
45048
|
45049
|
45050
|
45051
|
45052
|
45053
|
46397
|
46398
|
46399
|
46400
|
46401
|
46402
|
56469
|
56470
|
56471
|
56472
|
56473
|
56474