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

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


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

--- Comment #1 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
(In reply to Pedro Amorim from comment #0)
> We should standardize the way plugin hooks are implemented and behave.

> Others are just called like:
> Some hooks return stuff (e.g. opac_detail_xslt_variables), others expect the
> param to be a ref and change in place without returning anything (e.g.
> patron_barcode_transform)

The ->call pattern is more recent. I think we should go in that direction.

> We already have hooks that behave like actions, and others that behave like
> filters.
> - Make it clear that a hook is either an action or a filter, either by name
> or by the way it's called

Not sure what you exactly mean with a filter here. But a plugin could modify or
just return results that allow further customization.
If you pass a ref to a plugin, you wont know what will happen. So you cant say
that it is just a filter or so? Passing that ref means that it may be changed.
Calling the plugin may lead to db changes too. The name is no protection..

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


More information about the Koha-bugs mailing list