From 6858da97c361fe9a5fddfed7c6d9b1103b27dca0 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 18 Jun 2008 14:50:22 -0500 Subject: [PATCH] bug 2258 - do not duplicate embedded items If a MARC bib is modified by this batch job, do not duplicate the item tags embedded in it (e.g., 952 for MARC21). When modifying a bib record, any embedded item tags must be removed before calling ModBiblio - perhaps this should be moved to ModBiblio itself. Also removed an error in the job's help text. Signed-off-by: Joshua Ferraro --- misc/link_bibs_to_authorities.pl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/misc/link_bibs_to_authorities.pl b/misc/link_bibs_to_authorities.pl index 1cb0483fd8..9954fd66bf 100755 --- a/misc/link_bibs_to_authorities.pl +++ b/misc/link_bibs_to_authorities.pl @@ -85,6 +85,11 @@ sub process_bib { print "Bib $biblionumber ($title): $headings_changed headings changed\n"; } if (not $test_only) { + # delete any item tags + my ($itemtag, $itemsubfield) = GetMarcFromKohaField("items.itemnumber", ''); + foreach my $field ($bib->field($itemtag)) { + $bib->delete_field($field); + } ModBiblio($bib, $biblionumber, GetFrameworkCode($biblionumber)); $num_bibs_modified++; } @@ -111,10 +116,6 @@ Parameters: --test only test the authority linking and report the results; do not change the bib records. - --comment optional comment to describe - the record batch; if the comment - has spaces in it, surround the - comment with quotation marks. --help or -h show this message. _USAGE_ } -- 2.11.0