[Koha-bugs] [Bug 26351] Add plugin hooks to transform item barcodes

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Sep 11 14:16:27 CEST 2020


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

--- Comment #6 from Kyle M Hall <kyle at bywatersolutions.com> ---
(In reply to Julian Maurice from comment #5)
> I would like to make a suggestion about the hook name: IMO hooks should be
> named after an event (what just happened in Koha) rather than what the
> plugin is supposed to do. From what I understood this hook will be called
> every time a barcode is scanned. A plugin can choose to do other things than
> transforming the barcode (log it somewhere, transmit it to an external
> webservice, ...), so it would be more generic to call it "barcode_scanned"
> or something like that.

I'm happy to change that!

> Also, I took a quick look at the code and I have a concern: what will happen
> if two (or more) plugins implement this hook ? It looks like only the return
> value from the first plugin will be used. We can imagine one want to
> implement item barcode transform in one plugin and patron barcode transform
> in another.

In it's current state, the last plugin 'wins'. A couple solutions would be to:
A) Modify call() to feed the result of the last plugin call into the next one
B) Split the hooks into separate methods

I'm much more inclined to go with B. What do you think Julian?

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


More information about the Koha-bugs mailing list