@@ -, +, @@ this routine. The subfields of the old record are not relevant when removing all references in the linked biblio records. --- C4/AuthoritiesMarc.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) --- a/C4/AuthoritiesMarc.pm +++ a/C4/AuthoritiesMarc.pm @@ -692,7 +692,7 @@ Deletes $authid and calls merge to cleanup in linked biblio records sub DelAuthority { my ($authid) = @_; my $dbh=C4::Context->dbh; - merge({ mergefrom => $authid, MARCfrom => GetAuthority($authid) }); + merge({ mergefrom => $authid }); $dbh->do( "DELETE FROM auth_header WHERE authid=?", undef, $authid ); logaction( "AUTHORITIES", "DELETE", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog"); ModZebra( $authid, "recordDelete", "authorityserver", undef); @@ -1370,7 +1370,7 @@ sub AddAuthorityTrees{ $count = merge({ mergefrom => mergefrom, - MARCfrom => $MARCfrom, + [ MARCfrom => $MARCfrom, ] [ mergeto => $mergeto, ] [ MARCto => $MARCto, ] [ biblionumbers => [ $a, $b, $c ], ] @@ -1382,6 +1382,12 @@ If $mergeto equals mergefrom, the linked biblio field is updated. If $mergeto is different, the biblio field will be linked to $mergeto. If $mergeto is missing, the biblio field is deleted. +MARCfrom and MARCto are not needed when merging deleted authority records. +MARCfrom is used to determine if a cleared subfield in the authority record +should be removed from a biblio. MARCto is used to populate the biblio +record with the updated values. So it is not optional when merging +existing records! + Normally all biblio records linked to $mergefrom, will be considered. But you can pass specific numbers via the biblionumbers parameter. @@ -1436,7 +1442,7 @@ sub merge { my @record_from; @record_from = $MARCfrom->field($auth_tag_to_report_from)->subfields() if $auth_tag_to_report_from && $MARCfrom && $MARCfrom->field($auth_tag_to_report_from); - # Get All candidate Tags for the change + # Get all candidate tags for the change # (This will reduce the search scope in marc records). # For a deleted authority record, we scan all auth controlled fields my $dbh = C4::Context->dbh; --