From 59f27713144345061a3b29029298e322d10307d1 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Mon, 29 Apr 2013 14:15:11 +0000 Subject: [PATCH] Bug 7419: merge sub should retrieve marc records from DB if not given --- C4/AuthoritiesMarc.pm | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 45ab8c2..e791e53 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -1382,11 +1382,15 @@ Then we should add some new parameter : bibliotargettag, authtargettag =cut sub merge { - my ($mergefrom,$MARCfrom,$mergeto,$MARCto) = @_; + my ($mergefrom, $MARCfrom, $mergeto, $MARCto) = @_; my @editedbiblios; - my $dbh=C4::Context->dbh; + 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; -- 1.7.2.5