X-Git-Url: http://git.equinoxoli.org/?p=koha-equinox.git;a=blobdiff_plain;f=C4%2FBiblio.pm;h=d7c749144b52c3d0aead099ff8caf8d4f16cb69a;hp=13926ef93931b10d1e0d2f39cd223c935bcd4a69;hb=e600ae6c4b125ee40ce80346ce15f954a1fa424d;hpb=d9cefbdd19c35ae83d0ffa59ca99aaf4bc775cac diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 13926ef..d7c7491 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -240,7 +240,7 @@ sub AddBiblio { =head2 ModBiblio - ModBiblio( $record,$biblionumber,$frameworkcode); + ModBiblio( $record,$biblionumber,$frameworkcode, $disable_autolink); Replace an existing bib record identified by C<$biblionumber> with one supplied by the MARC::Record object C<$record>. The embedded @@ -256,12 +256,16 @@ in the C and C tables, as well as which fields are used to store embedded item, biblioitem, and biblionumber data for indexing. +Unless C<$disable_autolink> is passed ModBiblio will relink record headings +to authorities based on settings in the system preferences. This flag allows +us to not relink records when the authority linker is saving modifications. + Returns 1 on success 0 on failure =cut sub ModBiblio { - my ( $record, $biblionumber, $frameworkcode ) = @_; + my ( $record, $biblionumber, $frameworkcode, $disable_autolink ) = @_; if (!$record) { carp 'No record passed to ModBiblio'; return 0; @@ -272,7 +276,7 @@ sub ModBiblio { logaction( "CATALOGUING", "MODIFY", $biblionumber, "biblio BEFORE=>" . $newrecord->as_formatted ); } - if (C4::Context->preference('BiblioAddsAuthorities')) { + if ( !$disable_autolink && C4::Context->preference('BiblioAddsAuthorities') ) { BiblioAutoLink( $record, $frameworkcode ); } @@ -624,12 +628,10 @@ safest place. sub _check_valid_auth_link { my ( $authid, $field ) = @_; - require C4::AuthoritiesMarc; my $authorized_heading = C4::AuthoritiesMarc::GetAuthorizedHeading( { 'authid' => $authid } ) || ''; - return ($field->as_string('abcdefghijklmnopqrstuvwxyz') eq $authorized_heading); }