[Koha-bugs] [Bug 34713] Standardize plugin hooks

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Sep 5 14:24:13 CEST 2023


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

Julian Maurice <julian.maurice at biblibre.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |julian.maurice at biblibre.com

--- Comment #2 from Julian Maurice <julian.maurice at biblibre.com> ---
I don't think the distinction between filters and actions is that important. A
plugin method can do both. For instance an item_barcode_transform hook can
modify the barcode, or log it somewhere, or both.
Sure, the caller sometimes expects the plugin to act as a filter (like
item_barcode_transform) but most of the times it does not expect anything. It's
more like "This event just happened (or will happen right now), do what you
want with that info"

I think standardizing name cannot be a bad thing, but the thing that matters
the most (to me at least) is a proper documentation of the hook arguments: what
they contain and if (and how) they are used after the hook returns.

In some implementations of an event manager, the event listener (the hook) gets
an object acting as a container for the event and its parameter. Maybe we can
take inspirations from that to standardize the hook signatures.

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


More information about the Koha-bugs mailing list