[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
Thu Jul 1 16:24:10 CEST 2021


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

--- Comment #23 from Kyle M Hall <kyle at bywatersolutions.com> ---
(In reply to Mark Hofstetter from comment #21)
> As stated before I consider the plugin system to explicit ie you have to
> "tell" every function/method that there may be a plugin.
> 
> For example something I am currently working on:
> 
> Problem: Customer wants to change how patron cardnumbers are autogenerated,
> (a prefix and a fixed padded length)
> 
> One could make a plugin for Koha::Patron::fixup_cardnumber 
> 
> OR, my suggestion (semi pseudo code, I hop my intentions are clear)
> 
> extend the base class(es) in this case
> 
> Koha::Object->_new_from_dbic();
> 
> if (<hooksenabled>) {
> require KohaObjectHooks; # whatever
> }
> 
> 
> KohaObjectHooks
> 
> use Hook::LexWrap;
> wrap 'Koha::Patron::fixup_cardnumber', post =>
>    sub { my ( $self ) = @_;
>         $self->cardnumber( sprintf("LB%09d",  $self->cardnumber));
>    };
> 
> 
> 
> Hook::LexWrap hat pre/post a around hook may be implemented easily
> 
> I know this a major change, but solves a least some problems

That's interesting. I'd love to see a proof of concept!

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


More information about the Koha-bugs mailing list