@@ -, +, @@ after_patron_action hook. for the hook has been called with the right parameters. --- Koha/Patron.pm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) --- a/Koha/Patron.pm +++ a/Koha/Patron.pm @@ -268,6 +268,8 @@ sub store { logaction( "MEMBERS", "CREATE", $self->borrowernumber, "" ) if C4::Context->preference("BorrowersLog"); + + $self->get_from_storage->_after_patron_action_hooks({ action => 'create' }); } else { #ModMember @@ -341,6 +343,8 @@ sub store { # Final store $self = $self->SUPER::store; + + $self->get_from_storage->_after_patron_action_hooks({ action => 'modify' }); } } ); @@ -395,6 +399,8 @@ sub delete { $self->SUPER::delete; logaction( "MEMBERS", "DELETE", $self->borrowernumber, "" ) if C4::Context->preference("BorrowersLog"); + + $self->_after_patron_action_hooks({ action => 'delete' }); } ); return $self; @@ -1794,6 +1800,27 @@ sub to_api_mapping { =head2 Internal methods +=head3 _after_patron_action_hooks + +Helper method that takes care of calling all plugin hooks + +=cut + +sub _after_patron_action_hooks { + my ( $self, $params ) = @_; + + my $action = $params->{action}; + + Koha::Plugins->call( + 'after_patron_action', + { + action => $action, + patron => $self, + patron_id => $self->borrowernumber, + } + ); +} + =head3 _type =cut --