[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
Wed Oct 6 12:27:30 CEST 2021


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

Jonathan Druart <jonathan.druart+koha at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #124258|0                           |1
        is obsolete|                            |
 Attachment #124259|0                           |1
        is obsolete|                            |
 Attachment #124260|0                           |1
        is obsolete|                            |
 Attachment #124261|0                           |1
        is obsolete|                            |
 Attachment #124262|0                           |1
        is obsolete|                            |
 Attachment #124263|0                           |1
        is obsolete|                            |
 Attachment #124264|0                           |1
        is obsolete|                            |
 Attachment #124265|0                           |1
        is obsolete|                            |
 Attachment #124266|0                           |1
        is obsolete|                            |
 Attachment #124313|0                           |1
        is obsolete|                            |
 Attachment #125447|0                           |1
        is obsolete|                            |
 Attachment #125763|0                           |1
        is obsolete|                            |
 Attachment #125764|0                           |1
        is obsolete|                            |

--- Comment #104 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
Created attachment 125765
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125765&action=edit
Bug 26351: Add plugin hooks to transform item barcodes

Some of our partners have unusual barcode requirements that have
required us to transform scanned barcodes using javascript. This is not
the most reliable method. It would make more sense to have Koha
transform the barcodes on the backend using a plugin. We should add
hooks to transform and generate new item and patron barcodes.

Test Plan:
1) Apply this patch
2) Download and install the Barcode Transformer plugin
  
https://github.com/bywatersolutions/koha-plugin-barcode-transformer/releases/
3) Go to the plugin configuration page, set the configuration to the example
configuration from the same page
4) In the item barcode field on the checkin and checkout pages,
   and anywhere else you can scan an item barcode, type in some
   valid barcodes, but prefix them with X and postfix them with
   Y, e.g. X123456Y
5) Note the letters are removed by Koha!

Signed-off-by: Lucas Gass <lucas at bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Bug 26351: (QA follow-up) Fix QA script issue

* Fixes issue with barcode generate stub so perlcritic is happy
* Removes extra semicolon from return call in configure method

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Bug 26351: Add unit tests

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Bug 26351: (QA follow-up) Remove unused method barcode_transform

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Bug 26351: (QA follow-up) Rename barcode_transform to item_barcode_transform

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Bug 26351: (QA follow-up) Barcodes inputted into Koha should always pass though
barcodedecode

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Bug 26351: (QA follow-up) Catch one last case of itemBarcodeInputFilter

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Bug 26351: (QA follow-up) Fix Checkouts.t

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Bug 26351: Use call_recursive() as a replacement for call()

The method `call()` is not sufficient for barcode transformations. It's
possible that more than one barcode transformation plugin will be
installed. The `call_recursive()` method takes the output of the first
plugin and uses it as the input for the next plugin and so on. This allowes
each plugin to see the current version of the barcode and modify it if
necessary.

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Bug 26351: Fix t/db_dependent/Koha/Plugins/Circulation_hooks.t

Bug 26351: Revert improper change to unit test, fix number of tests

Bug 26351: Remove uneeded use Koha::Plugins statements

Left over from previous changes

Bug 26351: Add missing barcodedecode import

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


More information about the Koha-bugs mailing list