https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28026
--- Comment #23 from Kyle M Hall <[email protected]> --- (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. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
