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.
Created attachment 106577 [details] [review] Bug 25712: Add plugin hooks to transform patron and 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.
Created attachment 106578 [details] [review] Bug 25712: Add plugin hooks to transform patron and 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/download/v1.0.1/koha-plugin-barcode-transformer-v1.0.1.kpz 3) Go to the plugin configuration page, set the configuration to the example configuration from the same page 4) In the patron search and anywhere else you can scan a patron cardnumber, type in some cardnumbers but prefix them with A and postfix them with A or B, e.g. A12345A, A12345B 5) Note the letters are removed by Koha! 6) Try a cardnumber like X123456Y 7) Note Koha converts it to Z13456Z 8) Try an item barcode now with the same A A|B format from step 4 9) The item barcode should have the letters removed by Koha as well!
Created attachment 106579 [details] [review] Bug 25712: Add plugin hooks to transform patron and 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 patron search and anywhere else you can scan a patron cardnumber, type in some cardnumbers but prefix them with A and postfix them with A or B, e.g. A12345A, A12345B 5) Note the letters are removed by Koha! 6) Try a cardnumber like X123456Y 7) Note Koha converts it to Z13456Z 8) Try an item barcode now with the same A A|B format from step 4 9) The item barcode should have the letters removed by Koha as well!
Patch doesn't apply. Thanks!
Can you please update https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks too? Thanks!
Created attachment 107125 [details] [review] Bug 25712: Add plugin hooks to transform patron and 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 patron search and anywhere else you can scan a patron cardnumber, type in some cardnumbers but prefix them with A and postfix them with A or B, e.g. A12345A, A12345B 5) Note the letters are removed by Koha! 6) Try a cardnumber like X123456Y 7) Note Koha converts it to Z13456Z 8) Try an item barcode now with the same A A|B format from step 4 9) The item barcode should have the letters removed by Koha as well!
Works awesome! The QA tool raised a few issues: OK C4/Circulation.pm OK C4/ILSDI/Services.pm OK C4/Items.pm OK C4/SIP/Sip/MsgType.pm OK Koha/Item.pm OK Koha/Patron.pm OK Koha/Patron/Attribute.pm FAIL cataloguing/additem.pl FAIL valid Global symbol "$addedolditem" requires explicit package name (did you forget to declare "my $addedolditem"?) Global symbol "$addedolditem" requires explicit package name (did you forget to declare "my $addedolditem"?) OK circ/circulation.pl OK circ/returns.pl OK members/memberentry.pl OK offline_circ/process_koc.pl OK opac/sco/sco-main.pl OK t/db_dependent/Koha/Plugins/Plugins.t FAIL t/lib/Koha/Plugin/Test.pm FAIL critic # Variables::ProhibitUnusedVariables: Got 1 violation(s). FAIL tools/batchMod.pl FAIL valid Global symbol "$barcode" requires explicit package name (did you forget to declare "my $barcode"?) tools/batchMod.pl had compilation errors. OK tools/inventory.pl
Created attachment 108831 [details] [review] Bug 25712: (QA follow-up) Fix QA script warnings
(In reply to Lucas Gass from comment #7) > FAIL cataloguing/additem.pl > FAIL valid > Global symbol "$addedolditem" requires explicit package name (did you > forget to declare "my $addedolditem"?) > Global symbol "$addedolditem" requires explicit package name (did you > forget to declare "my $addedolditem"?) Fixed! > FAIL t/lib/Koha/Plugin/Test.pm > FAIL critic > # Variables::ProhibitUnusedVariables: Got 1 violation(s). This one's a false alarm and can be ignored. > FAIL tools/batchMod.pl > FAIL valid > Global symbol "$barcode" requires explicit package name (did you forget to > declare "my $barcode"?) > tools/batchMod.pl had compilation errors. Fixed!
Created attachment 109051 [details] [review] Bug 25712: Add plugin hooks to transform patron and 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 patron search and anywhere else you can scan a patron cardnumber, type in some cardnumbers but prefix them with A and postfix them with A or B, e.g. A12345A, A12345B 5) Note the letters are removed by Koha! 6) Try a cardnumber like X123456Y 7) Note Koha converts it to Z13456Z 8) Try an item barcode now with the same A A|B format from step 4 9) The item barcode should have the letters removed by Koha as well! Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 109052 [details] [review] Bug 25712: (QA follow-up) Fix QA script warnings Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
I feel like this might have been better as 2 patches - cardnumbers and item barcodes separately. It touches a lot of the code, including SIP2, offline circulation etc. With this patch applied, but without any plugin installed: 1) When a barcode is not found, there is no error message, but only a page reload. 2) A patron search with the correct cardnumber (42 for sample data) in the checkout tab no longer brings up the patron. I think maybe we need to check for a plugin installed?
Moved to bugs 26351 and 26352