[Koha-bugs] [Bug 27066] Implement hooks for patrons updates

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Mar 10 09:17:07 CET 2021


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

Martin Renvoize <martin.renvoize at ptfs-europe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |martin.renvoize at ptfs-europe
                   |                            |.com

--- Comment #10 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
(In reply to Katrin Fischer from comment #7)
> Please document on https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks
> 
> Looking at the code and comparing with the similar after_item_action hooks I
> wonder about the placement in the code.
> 
> The implementation on bug 22709 adds the hooks before the logs are written,
> this adds them after.
> 
> I could imagine that plugins could actually change the data, so would result
> in a different logging result. So I think "before" would be better. What do
> you think?

Hmmm, 

tl;dr I don't think 'before' or 'after' hooks should directly affect the data
of the action.

We probably want 'before' and 'after' hooks.. and maybe even an 'around'.

Generally, a 'before' hook is for triggering actions prior to store (but not
affecting the data for the store itself).. 'after' is for triggering actions
after the store (like triggering zebraqueue.. again, it shouldn't affect the
data of the store itself) and an around wraps the store and returns the updated
data for the store to then act upon.

At least, that's my vague understanding of 'before', 'after', 'around' in other
frameworks?

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list