Bug 27577: Autolink biblio after biblionumber is generated
authorNick Clemens <nick@bywatersolutions.com>
Fri, 29 Jan 2021 13:33:34 +0000 (13:33 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 6 May 2021 13:52:38 +0000 (15:52 +0200)
commitb3baca4137ae6d4ef88022d3407d90b9677fcacf
treeeba87efa7c88c506a0c3a16768edc191d13d9bfd
parent9fab281e54d232cf026c838855869e76a7543718
Bug 27577: Autolink biblio after biblionumber is generated

If BiblioAddsAuthorities and AutoCreateAuthorities are enabled, a new record is auto linked when saving and authorities generated with a 670 field that indicates which record generated the new authority.

The code to do this is called before the biblionumber is generated, so the variable that adds the biblionumber to the citation is empty

This patch moves the linking code to after the biblionumber is generated

To recreate:
1 - Enable BiblioAddsAuthorities and AutoCreateAuthorities
2 - Import or create a new record
3 - Ensure the record has controlled fields that do not have authorities before saving, i.e.:
    Add a 650 with "test_bug_27577_01"
4 - Search for the authority record
5 - Note the 670 field does not contain the biblionumber
6 - Apply patch, restart all the things
7 - Repeat 2-4
8 - Note the 670 now has the biblionumber

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Biblio.pm