From 885d8a0480bfe7da523f865ebb8d897186981fd2 Mon Sep 17 00:00:00 2001 From: Ere Maijala Date: Mon, 17 Sep 2018 01:13:55 +0300 Subject: [PATCH] Bug 21365: Make advanced MARC editor honor BiblioAddsAuthorities To test: 1. Make sure BiblioAddsAuthorities and AutoCreateAuthorities preferences are enabled. 2. Add a new record using advanced editor, include a previously non-existing author. 3. Save the record and observe the author get an authority number. 4. Add another author, save the record and make sure it also gets an authority number. --- svc/bib | 3 +++ svc/new_bib | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/svc/bib b/svc/bib index 1cb176e..10f2fa8 100755 --- a/svc/bib +++ b/svc/bib @@ -114,6 +114,9 @@ sub update_bib { } } + if (C4::Context->preference('BiblioAddsAuthorities')) { + BiblioAutoLink( $record, $frameworkcode ); + } ModBiblio( $record, $biblionumber, $frameworkcode ); my $new_record = GetMarcBiblio({ biblionumber => $biblionumber, diff --git a/svc/new_bib b/svc/new_bib index 32e6fb1..9ba1b90 100755 --- a/svc/new_bib +++ b/svc/new_bib @@ -74,6 +74,10 @@ sub add_bib { foreach my $field ( $record->field($itemtag) ) { $record->delete_field($field); } + + if (C4::Context->preference('BiblioAddsAuthorities')) { + BiblioAutoLink( $record, $frameworkcode ); + } my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $record, $frameworkcode ); my $new_record = GetMarcBiblio({ biblionumber => $biblionumber }); if ( $query->url_param('items') ) { -- 2.7.4