From b4ea7f746aaac0a20f4f339197d21b00af6d790f 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. Signed-off-by: Michal Denar --- svc/bib | 3 +++ svc/new_bib | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/svc/bib b/svc/bib index 1cb176e..8827e18 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..cacabe2 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.1.4