Bugzilla – Attachment 39265 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]
[SIGNED_OFF] Bug 11700: C4::AuthoritiesMarc::merge enhancements/fixes
SIGNEDOFF-Bug-11700-C4AuthoritiesMarcmerge-enhance.patch (text/plain), 2.29 KB, created by
Bernardo Gonzalez Kriegel
on 2015-05-17 22:53:17 UTC
(
hide
)
Description:
[SIGNED_OFF] Bug 11700: C4::AuthoritiesMarc::merge enhancements/fixes
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2015-05-17 22:53:17 UTC
Size:
2.29 KB
patch
obsolete
>From 20c41e6534ddaf4f400b704d13dd24a7ee9522e0 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Thu, 6 Feb 2014 15:59:40 +0100 >Subject: [PATCH] [SIGNED_OFF] Bug 11700: C4::AuthoritiesMarc::merge > enhancements/fixes > >- Returns the list of modified biblio records >- Retrieve MARC records from DB if not given in parameters >- Delete source authority if source and destination records are > different > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >--- > C4/AuthoritiesMarc.pm | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 73ae128..7c5757d 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -1438,19 +1438,25 @@ sub AddAuthorityTrees{ > > =head2 merge > >- $ref= &merge(mergefrom,$MARCfrom,$mergeto,$MARCto) >+ my @edited_biblionumbers = merge(mergefrom, $MARCfrom, $mergeto, $MARCto); > > Could add some feature : Migrating from a typecode to an other for instance. > Then we should add some new parameter : bibliotargettag, authtargettag > >+Returns a list of biblionumbers of records that were modified. >+ > =cut > > sub merge { > my ($mergefrom, $MARCfrom, $mergeto, $MARCto) = @_; >- my ($counteditedbiblio,$countunmodifiedbiblio,$counterrors)=(0,0,0); >+ my @editedbiblios; > my $dbh = C4::Context->dbh; > my $authtypecodefrom = GetAuthTypeCode($mergefrom); > my $authtypecodeto = GetAuthTypeCode($mergeto); >+ >+ $MARCfrom ||= GetAuthority($mergefrom); >+ $MARCto ||= GetAuthority($mergeto); >+ > # warn "mergefrom : $authtypecodefrom $mergefrom mergeto : $authtypecodeto $mergeto "; > # return if authority does not exist > return "error MARCFROM not a marcrecord ".Data::Dumper::Dumper($MARCfrom) if scalar($MARCfrom->fields()) == 0; >@@ -1555,11 +1561,13 @@ sub merge { > } > if ($update==1){ > &ModBiblio($marcrecord,$biblionumber,GetFrameworkCode($biblionumber)) ; >- $counteditedbiblio++; >- warn $counteditedbiblio if (($counteditedbiblio % 10) and $ENV{DEBUG}); >+ push @editedbiblios, $biblionumber; > } > }#foreach $marc >- return $counteditedbiblio; >+ >+ DelAuthority($mergefrom) if ($mergefrom != $mergeto); >+ >+ return @editedbiblios; > } > > =head2 get_auth_type_location >-- >1.7.9.5
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