Bug 21957

Summary: LinkBibHeadingsToAuthorities can be called twice when running link_bibs_to_authorities
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: MARC Authority data supportAssignee: Nick Clemens (kidclamp) <nick>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: 1joynelson, black23, ere.maijala, lucas, m.de.rooy, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
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
Circulation function:
Attachments: Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker
Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker
Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker
Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker
Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker

Description Nick Clemens (kidclamp) 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 (kidclamp) 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 (kidclamp) 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 (kidclamp) 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 (kidclamp) 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 (kidclamp) 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 (kidclamp) 2019-04-18 12:06:58 UTC
Awesome work all!

Pushed to master for 19.05
Comment 13 Martin Renvoize (ashimema) 2019-04-26 13:45:01 UTC
Pushed to 18.11.x for 18.11.05
Comment 14 Lucas Gass (lukeg) 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