Bug 21957 - LinkBibHeadingsToAuthorities can be called twice when running link_bibs_to_authorities
Summary: LinkBibHeadingsToAuthorities can be called twice when running link_bibs_to_au...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Authority data support (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-05 21:05 UTC by Nick Clemens
Modified: 2020-06-04 20:32 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.00, 18.11.05


Attachments
Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker (3.07 KB, patch)
2018-12-05 21:09 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker (3.71 KB, patch)
2019-01-23 01:12 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker (4.41 KB, patch)
2019-04-15 12:40 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker (4.46 KB, patch)
2019-04-15 19:16 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker (4.51 KB, patch)
2019-04-17 10:21 UTC, Josef Moravec
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2018-12-05 21:05:14 UTC
The linker takes a bib, call LinkBibHeadingsToAuthorities, and if it makes updates it then calls ModBiblio - if 'BiblioAddsAuthorities' is set, ModBiblio then calls LinkBibHeadingsToAuthorities for the same bib.
Comment 1 Nick Clemens 2018-12-05 21:09:13 UTC
Created attachment 82893 [details] [review]
Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker

To test:
1 - prove -v t/db_dependent/Biblio.t
2 - Set BiblioAddsAuthoorities and AutoCreateAuthorities
3 - Modify a biblio to add a heading with no existing auth record
4 - Ensure the record was created on saving
5 - Ensure that editing works as normal otherwise
6 - Run link_bibs_to_authorities
7 - Ensure results are as expected
Comment 2 Marcel de Rooy 2018-12-13 14:47:20 UTC
You add this parameter. I would expect it to be used somewhere in the misc script for instance? What am I missing?
Comment 3 Nick Clemens 2018-12-13 15:41:52 UTC
(In reply to Marcel de Rooy from comment #2)
> You add this parameter. I would expect it to be used somewhere in the misc
> script for instance? What am I missing?

Looks like I missed a 'git add'
Comment 4 Nick Clemens 2019-01-23 01:12:09 UTC
Created attachment 84313 [details] [review]
Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker

To test:
1 - prove -v t/db_dependent/Biblio.t
2 - Set BiblioAddsAuthoorities and AutoCreateAuthorities
3 - Modify a biblio to add a heading with no existing auth record
4 - Ensure the record was created on saving
5 - Ensure that editing works as normal otherwise
6 - Run link_bibs_to_authorities
7 - Ensure results are as expected
Comment 5 Ere Maijala 2019-01-28 13:07:20 UTC
I'd call the parameter something like $disable_autolink to convey its meaning, and check it first to avoid a call to C4::Context->preference() if $disable_autolink is true.
Comment 6 Michal Denar 2019-04-15 11:43:10 UTC
Hi Nick,
it`s ready for testing or some follow-up based on Ere's comment are coming?

Thank you.
Comment 7 Nick Clemens 2019-04-15 12:40:01 UTC
Created attachment 88001 [details] [review]
Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker

To test:
1 - prove -v t/db_dependent/Biblio.t
2 - Set BiblioAddsAuthoorities and AutoCreateAuthorities
3 - Modify a biblio to add a heading with no existing auth record
4 - Ensure the record was created on saving
5 - Ensure that editing works as normal otherwise
6 - Run link_bibs_to_authorities
7 - Ensure results are as expected
Comment 8 Nick Clemens 2019-04-15 12:40:18 UTC
(In reply to Michal Denar from comment #6)
> Hi Nick,
> it`s ready for testing or some follow-up based on Ere's comment are coming?
> 
> Thank you.

Ready now
Comment 9 Michal Denar 2019-04-15 13:16:13 UTC
Great! Let's test it.

Thank you.
Comment 10 Michal Denar 2019-04-15 19:16:54 UTC
Created attachment 88033 [details] [review]
Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker

To test:
1 - prove -v t/db_dependent/Biblio.t
2 - Set BiblioAddsAuthoorities and AutoCreateAuthorities
3 - Modify a biblio to add a heading with no existing auth record
4 - Ensure the record was created on saving
5 - Ensure that editing works as normal otherwise
6 - Run link_bibs_to_authorities
7 - Ensure results are as expected

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 11 Josef Moravec 2019-04-17 10:21:40 UTC
Created attachment 88161 [details] [review]
Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker

To test:
1 - prove -v t/db_dependent/Biblio.t
2 - Set BiblioAddsAuthoorities and AutoCreateAuthorities
3 - Modify a biblio to add a heading with no existing auth record
4 - Ensure the record was created on saving
5 - Ensure that editing works as normal otherwise
6 - Run link_bibs_to_authorities
7 - Ensure results are as expected

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 12 Nick Clemens 2019-04-18 12:06:58 UTC
Awesome work all!

Pushed to master for 19.05
Comment 13 Martin Renvoize 2019-04-26 13:45:01 UTC
Pushed to 18.11.x for 18.11.05
Comment 14 Lucas Gass 2019-05-13 21:41:57 UTC
i cannot rebase this and successfully prove -v t/db_dependent/Biblio.t in 18.05.x, if needed please rebase.


Thanks