Bug 27577 - Autolink bibs after generating the biblionumber
Summary: Autolink bibs after generating the biblionumber
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens (kidclamp)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-29 13:32 UTC by Nick Clemens (kidclamp)
Modified: 2021-12-13 21:10 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.06,20.05.12


Attachments
Bug 27577: Autolink biblio after biblionumber is generated (2.09 KB, patch)
2021-01-29 13:36 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 27577: Autolink biblio after biblionumber is generated (2.14 KB, patch)
2021-02-12 21:28 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 27577: Autolink biblio after biblionumber is generated (2.20 KB, patch)
2021-02-14 14:07 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 27577: Unit test (1.60 KB, patch)
2021-05-05 18:34 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 27577: Autolink biblio after biblionumber is generated (2.20 KB, patch)
2021-05-05 18:34 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2021-01-29 13:32:56 UTC
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

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_01"
4 - Search for the authority record
5 - Note the 670 field does not contain the biblionumber
Comment 1 Nick Clemens (kidclamp) 2021-01-29 13:36:45 UTC
Created attachment 116030 [details] [review]
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
Comment 2 Phil Ringnalda 2021-02-12 21:28:53 UTC
Created attachment 116851 [details] [review]
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>
Comment 3 Katrin Fischer 2021-02-14 14:07:48 UTC
Created attachment 116854 [details] [review]
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>
Comment 4 Katrin Fischer 2021-02-14 14:08:17 UTC
Obviously a bug fix, but for the future I think a regression test would be really helpful here.
Comment 5 Jonathan Druart 2021-02-15 10:48:27 UTC
Nick, can you try to provide a test for this change please?
Comment 6 Nick Clemens (kidclamp) 2021-05-05 18:34:28 UTC
Created attachment 120559 [details] [review]
Bug 27577: Unit test
Comment 7 Nick Clemens (kidclamp) 2021-05-05 18:34:32 UTC
Created attachment 120560 [details] [review]
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>
Comment 8 Jonathan Druart 2021-05-07 12:41:19 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 9 Fridolin Somers 2021-05-11 14:03:21 UTC
Pushed to 20.11.x for 20.11.06
Comment 10 Andrew Fuerste-Henry 2021-05-25 12:07:20 UTC
Pushed to 20.05.x for 20.05.12
Comment 11 Victor Grousset/tuxayo 2021-05-25 14:27:32 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.