From e81391986d33a06e506f0a092b2e65396b59943a Mon Sep 17 00:00:00 2001 From: remi Date: Wed, 9 Mar 2016 11:48:31 -0500 Subject: [PATCH] Bug 16018 - Merges in AuthoritiesMarc do not work Skip ModAuthority sub in AuthoritiesMarc.pm to make merges work properly. Test plan: 1) Go to authority, search for anything 2) Click merge on two authorities of the same type that are used at least one time 3) Validate which subfields are corresponding to each authorities in the biblios that uses them 4) Do the whole merge process 5) Validate that the biblios are updated properly --- authorities/merge.pl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/authorities/merge.pl b/authorities/merge.pl index b423122..fe50df0 100755 --- a/authorities/merge.pl +++ b/authorities/merge.pl @@ -58,8 +58,17 @@ if ($merge) { $record->leader( GetAuthority($recordid1)->leader() ); # Modifying the reference record - ModAuthority( $recordid1, $record, $typecode ); + my $dbh=C4::Context->dbh; + my $overwrite = C4::Context->preference('overwriteSubfieldsOnMerge'); + my $MARCto = GetAuthority($recordid1); + my $MARCfrom = GetAuthority($recordid2); + if(C4::Context->preference('dontmerge') ne '1'){ + &merge($recordid2,$MARCfrom,$recordid1,$MARCto); + }else{ + my $sqlinsert="INSERT INTO need_merge_authorities (authid, done) "."VALUES (?,?)"; + $dbh->do($sqlinsert,undef,($recordid1,0)); + } # Deleting the other record if ( scalar(@errors) == 0 ) { -- 2.1.4