Bug 27173

Summary: Add plugin hooks for authority record changes
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Plugin architectureAssignee: Marcel de Rooy <m.de.rooy>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david, dcook, fridolin.somers, jonathan.druart+koha, kyle, martin.renvoize, tomascohen, victor
Version: masterKeywords: Manual
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Text to go in the release notes:
This enhancement allows plugin authors to implement an `after_authority_action` method in order to act upon authority create, modify and delete.
Version(s) released in:
21.11.00,21.05.05,20.11.12
Bug Depends on: 27155    
Bug Blocks:    
Attachments: Bug 27173: Add plugin hooks for authority record changes
Bug 27173: Add tests
Bug 27173: Add plugin hooks for authority record changes
Bug 27173: Add tests
Bug 27173: Add plugin hooks for authority record changes
Bug 27173: Add tests
Bug 27173: Add plugin hooks for authority record changes
Bug 27173: Add tests

Description Marcel de Rooy 2020-12-08 14:43:32 UTC
Authority counterpart for bug 22709 on biblio and item records
Comment 1 Marcel de Rooy 2021-09-28 13:44:40 UTC
Created attachment 125409 [details] [review]
Bug 27173: Add plugin hooks for authority record changes

2021-09-28 Updated version

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2021-09-28 13:44:43 UTC
Created attachment 125410 [details] [review]
Bug 27173: Add tests

Test plan:
Run t/db_dependent/Koha/Plugins/authority_hooks.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 3 Marcel de Rooy 2021-09-28 14:11:29 UTC
Created attachment 125411 [details] [review]
Bug 27173: Add plugin hooks for authority record changes

2021-09-28 Updated version

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2021-09-28 14:11:32 UTC
Created attachment 125412 [details] [review]
Bug 27173: Add tests

Test plan:
Run t/db_dependent/Koha/Plugins/authority_hooks.t
Comment 5 David Nind 2021-10-05 01:03:58 UTC
Created attachment 125715 [details] [review]
Bug 27173: Add plugin hooks for authority record changes

2021-09-28 Updated version

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2021-10-05 01:04:12 UTC
Created attachment 125716 [details] [review]
Bug 27173: Add tests

Test plan:
Run t/db_dependent/Koha/Plugins/authority_hooks.t

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2021-10-05 01:05:39 UTC
Testing notes (koha-testing-docker):

- Test plan was to apply patch and run tests
- Hopefully that is sufficient
Comment 8 Marcel de Rooy 2021-10-05 06:48:35 UTC
(In reply to David Nind from comment #7)
> Testing notes (koha-testing-docker):
> 
> - Test plan was to apply patch and run tests
> - Hopefully that is sufficient

Thanks David. The test script proves that a plugin on top of this action works. Which is sufficient.

We have been running a plugin based on this action for a year now in production. It copies the CREATE UPDATE DELETE actions to an external system where we try to reconcile authorities from several subsystems.
Comment 9 Katrin Fischer 2021-10-06 19:09:19 UTC
Please remember to update https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks :)
Comment 10 Martin Renvoize 2021-10-15 07:32:35 UTC
Created attachment 126307 [details] [review]
Bug 27173: Add plugin hooks for authority record changes

2021-09-28 Updated version

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize 2021-10-15 07:32:39 UTC
Created attachment 126308 [details] [review]
Bug 27173: Add tests

Test plan:
Run t/db_dependent/Koha/Plugins/authority_hooks.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize 2021-10-15 07:33:04 UTC
Well tested, QA scripts happy, all works as expected.

Passing QA
Comment 13 Jonathan Druart 2021-11-03 13:34:11 UTC
Please add it to the wiki page: https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks
Comment 14 Jonathan Druart 2021-11-03 14:30:13 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 15 Marcel de Rooy 2021-11-03 14:44:50 UTC
(In reply to Jonathan Druart from comment #13)
> Please add it to the wiki page:
> https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks

Done
Comment 16 Kyle M Hall 2021-11-05 18:22:26 UTC
Pushed to 21.05.x for 21.05.05
Comment 17 Kyle M Hall 2021-11-05 18:22:42 UTC
Backported for plugins compatibility
Comment 18 Fridolin Somers 2021-11-12 22:36:57 UTC
Pushed to 20.11.x for 20.11.12
Also backported for plugins compatibility
Comment 19 Victor Grousset/tuxayo 2021-11-16 08:14:01 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.