Bug 22709: Add after biblio/item action hooks
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 21 Jun 2019 20:10:23 +0000 (17:10 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 4 Jul 2019 12:49:38 +0000 (13:49 +0100)
commit79917ad0bf269148ec470591a9a44bc015efb74a
treee3c36cfadef0307665ebb46ce536b9e2b088dc47
parentd766b6926bc104bd10050f1f49d4414dc9555475
Bug 22709: Add after biblio/item action hooks

This patch introduces after-action hooks for
- C4::Biblio::{Add|Mod|Del}Biblio
- C4::Items::{Add|Mod|Del}Biblio

After the action has taken place, a call to a helper method is done,
which loops through all plugins implementing the hooks, and calls the
plugin method. The related object is passed, along with an 'action'
string specifying the action that took place, and the object id (which
is specially important for the 'Del' case).

To test:
- Apply this patchset
- Run:
  $ kshell
 k$ prove t/db_dependent/Biblio_and_Items_plugin_hooks.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
C4/Biblio.pm
C4/Items.pm