https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40984

--- Comment #9 from David Nind <[email protected]> ---
Created attachment 211181
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211181&action=edit
Bug 40984: Synchronize before_ and after_authority_action hooks with biblio
action hooks

This patch updates the authority action plugin hooks to match the
signature and behavior of the biblio action hooks:

1. Add a before_authority_action hook, called before an authority record
   is saved. It is called once the record is complete, after the 001 is
   set and before the heading is derived from it, so plugins get the
   authority_id for new authorities too and can still change the record
   (including its heading fields) before it is stored.

2. Update the after_authority_action hook to pass its data in a payload,
   like after_biblio_action: authority, authority_id and record. The
   authority object is the one the action was done on, so for a delete
   plugins can still get its details, for example its authtypecode.

3. Keep the old parameters (authority and authority_id outside of the
   payload) so that existing plugins keep working. They are deprecated,
   as noted in an atomic update, as was done for the biblio hooks in bug
   36343, instead of a warning logged on every action.

4. Update the test plugin to use the payload-based signatures, and add
   test coverage for both hooks.

To test:
1. prove t/db_dependent/Koha/Plugins/authority_hooks.t
2. prove t/db_dependent/Koha/Plugins/ t/db_dependent/AuthoritiesMarc.t
3. All tests should pass
4. perl installer/data/mysql/updatedatabase.pl
=> Warnings for plugin authors about the changed hooks
5. Sign off :-D

Signed-off-by: David Nind <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to