[Bug 26352] New: Add plugin hooks to transform patron barcodes
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Bug ID: 26352 Summary: Add plugin hooks to transform patron barcodes Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Plugin architecture Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Moved from bug 25712 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. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 109533 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109533&action=edit Bug 26352: Add plugin hooks to transform patron 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 Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |26351 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26351 [Bug 26351] Add plugin hooks to transform item barcodes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #109533|0 |1 is obsolete| | --- Comment #2 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 109547 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109547&action=edit Bug 26352: Add plugin hooks to transform patron 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 Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Signed Off |Failed QA --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- We're missing unit tests here I'm afraid. I beleive there is prior art for such tests that we need added for the Koha::Patron change here. Failing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #109547|0 |1 is obsolete| | --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 113579 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113579&action=edit Bug 26352: Add plugin hooks to transform patron 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 Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 113580 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113580&action=edit Bug 26352: Add unit test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #6 from Fridolin Somers <fridolin.somers@biblibre.com> --- I update the doc in https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Damn.. I thought I switched this to PQA already :( -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- There's an undocumented feature here: When 'autoMemberNum' is enabled there's a second plugin hook available called 'barcode_generate'. I'm wondering if this needs to be an explicit method of it's own as currently implemented or it could just be the case for when an empty or undefined cardnumber is passed to the patron_barcode_transform hook? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Martin Renvoize from comment #8)
There's an undocumented feature here: When 'autoMemberNum' is enabled there's a second plugin hook available called 'barcode_generate'.
I'm wondering if this needs to be an explicit method of it's own as currently implemented or it could just be the case for when an empty or undefined cardnumber is passed to the patron_barcode_transform hook?
I like the simplicity of your latter idea. I'll submit a followup to make that change! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #10 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 113880 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113880&action=edit Bug 26352: Replace call to barcode_generate with call to patron_barcode_transform -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Fridolin Somers from comment #6)
I update the doc in https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks
Thanks Frido! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113579|0 |1 is obsolete| | --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 113885 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113885&action=edit Bug 26352: Add plugin hooks to transform patron 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 Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113580|0 |1 is obsolete| | --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 113886 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113886&action=edit Bug 26352: Add unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113880|0 |1 is obsolete| | --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 113887 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113887&action=edit Bug 26352: Replace call to barcode_generate with call to patron_barcode_transform Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 113888 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113888&action=edit Bug 26352: (QA follow-up) Add additional tests This patch adds additional unit tests for autoMemberNum handling and corrects the implimentation there. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Works well and is now fully tested. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement adds a release notes| |plugin hook to transform | |patron cardnumbers scanned | |in to Koha. For example, if | |you need to alter your | |scanned cardnumbers, but | |your scanners cannot be | |programmed to do so, a | |plugin could be written to | |handle that change in Koha | |instead. One example would | |be to drop the first and | |last characters of the | |scanned barcode, which may | |be check digits rather than | |part of the barcode itself. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | CC| |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113885|0 |1 is obsolete| | Attachment #113886|0 |1 is obsolete| | Attachment #113887|0 |1 is obsolete| | Attachment #113888|0 |1 is obsolete| | --- Comment #17 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 115167 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115167&action=edit Bug 26352: Add plugin hooks to transform patron 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 Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #18 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 115168 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115168&action=edit Bug 26352: Add unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #19 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 115169 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115169&action=edit Bug 26352: Replace call to barcode_generate with call to patron_barcode_transform Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #20 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 115170 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115170&action=edit Bug 26352: (QA follow-up) Add additional tests This patch adds additional unit tests for autoMemberNum handling and corrects the implimentation there. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #21 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 115171 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115171&action=edit Bug 26352: Switch from using call() to call_recursive() -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115167|0 |1 is obsolete| | --- Comment #22 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 118691 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118691&action=edit Bug 26352: Add plugin hooks to transform patron 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 Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115168|0 |1 is obsolete| | --- Comment #23 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 118692 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118692&action=edit Bug 26352: Add unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115169|0 |1 is obsolete| | --- Comment #24 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 118693 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118693&action=edit Bug 26352: Replace call to barcode_generate with call to patron_barcode_transform Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115170|0 |1 is obsolete| | --- Comment #25 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 118694 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118694&action=edit Bug 26352: (QA follow-up) Add additional tests This patch adds additional unit tests for autoMemberNum handling and corrects the implimentation there. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115171|0 |1 is obsolete| | --- Comment #26 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 118695 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118695&action=edit Bug 26352: Switch from using call() to call_recursive() Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #27 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Tested and passed the final followup patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |BLOCKED --- Comment #28 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Blocked by bug 28026. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |28211 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28211 [Bug 28211] Replace use of call_recursive() with call() -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |BLOCKED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #118691|0 |1 is obsolete| | Attachment #118692|0 |1 is obsolete| | Attachment #118693|0 |1 is obsolete| | Attachment #118694|0 |1 is obsolete| | Attachment #118695|0 |1 is obsolete| | --- Comment #29 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 122428 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122428&action=edit Bug 26352: Add plugin hooks to transform patron 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 Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #30 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 122429 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122429&action=edit Bug 26352: Add unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #31 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 122430 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122430&action=edit Bug 26352: Replace call to barcode_generate with call to patron_barcode_transform Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #32 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 122431 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122431&action=edit Bug 26352: (QA follow-up) Add additional tests This patch adds additional unit tests for autoMemberNum handling and corrects the implimentation there. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #33 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 122432 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122432&action=edit Bug 26352: Switch from using call() to call_recursive() Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #34 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #35 from Fridolin Somers <fridolin.somers@biblibre.com> --- This is great. I've edited "First version" in https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Bug 26352 depends on bug 26351, which changed state. Bug 26351 Summary: Add plugin hooks to transform item barcodes https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26351 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to master |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #36 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Fridolin Somers from comment #35)
This is great. I've edited "First version" in https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks
Thanks Frido! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #37 from David Nind <david@davidnind.com> --- This no longer seems to work unless I haven't set something up right. I added an A as a suffix and prefix to Bug 29637 in the patron search. The plugin installed okay (I used the latest version) and I copied the configuration in. I was testing Bug 29637 - which indicates this bug broke AutoSwitchPatron. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29637 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #38 from Fridolin Somers <fridolin.somers@biblibre.com> --- If you used plugin koha-plugin-barcode-transformer, I confirm it does not work. I've opened an issue : https://github.com/bywatersolutions/koha-plugin-barcode-transformer/issues/5 I've created a pull-request on KitchenSink to add an easy example for this two hooks : https://github.com/bywatersolutions/dev-koha-plugin-kitchen-sink/pull/17 Those hooks use a ref to value which is not easy to understand, we have to document it well. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #39 from David Nind <david@davidnind.com> --- (In reply to Fridolin Somers from comment #38)
If you used plugin koha-plugin-barcode-transformer, I confirm it does not work.
Thanks Fridolin! I had used that plugin. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #40 from David Cook <dcook@prosentient.com.au> --- I find this plugin really confusing, since it's called in a wide variety of different contexts... Perhaps it would've made sense to break it up into patron_barcode_transform and patron_generate_cardnumber... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #41 from David Cook <dcook@prosentient.com.au> --- (In reply to Martin Renvoize from comment #8)
There's an undocumented feature here: When 'autoMemberNum' is enabled there's a second plugin hook available called 'barcode_generate'.
I'm wondering if this needs to be an explicit method of it's own as currently implemented or it could just be the case for when an empty or undefined cardnumber is passed to the patron_barcode_transform hook?
Apparently this was already discussed. I would've preferred a second hook for sure. I thought maybe it would be safe to create a new cardnumber when it's empty/undefined, but Koha::Patron::store() has some oddities. Like "patron_barcode_transform" gets called twice if you're using autoMemberNum... and fixup_cardnumber() assumes the output of autoMemberNum is an integer, which seems presumptuous especially when the original use case talked about prefixing/suffixing cardnumbers with letters... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #42 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #41)
(In reply to Martin Renvoize from comment #8)
There's an undocumented feature here: When 'autoMemberNum' is enabled there's a second plugin hook available called 'barcode_generate'.
I'm wondering if this needs to be an explicit method of it's own as currently implemented or it could just be the case for when an empty or undefined cardnumber is passed to the patron_barcode_transform hook?
Apparently this was already discussed.
I would've preferred a second hook for sure. I thought maybe it would be safe to create a new cardnumber when it's empty/undefined, but Koha::Patron::store() has some oddities. Like "patron_barcode_transform" gets called twice if you're using autoMemberNum... and fixup_cardnumber() assumes the output of autoMemberNum is an integer, which seems presumptuous especially when the original use case talked about prefixing/suffixing cardnumbers with letters...
I've developed a plugin to create an alphanumeric cardnumber if there's no cardnumber passed into "patron_barcode_transform", and yeah it doesn't work if you're using "autoMemberNum". If you're using "autoMemberNum", the cardnumber referenced in "patron_barcode_transform" must be a positive integer, or you'll run into strife. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org