[Koha-bugs] [Bug 28026] Add a 'call_recursive' method to Koha::Plugins

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Apr 16 12:11:30 CEST 2021


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

--- Comment #8 from Julian Maurice <julian.maurice at biblibre.com> ---
(In reply to Mark Hofstetter from comment #7)
> I doubt that call() is sufficient, and as call_recursive() just adds
> functionality and does not interfere with the rest of teh plugin system.
> I'll try to QA it.

It is sufficient. I tested it. It's just a little less convenient for the
caller when you want scalars to be modified (like in bug 26351 and bug 26252).
Otherwise for objects it works very well:

Koha::Plugins->call('object_transform', $object)

will allow $object to be modified by all plugins. This is also true for
hashrefs and arrayrefs.

I believe call_recursive would be useful only for scalar values (and 'call' can
already be used for that as shown in bug 26351 comment 7). And it duplicates
the code of Koha::Plugins::call, which should be avoided IMO.

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


More information about the Koha-bugs mailing list