The label creator can accept a list of either itemnumbers or item barcodes. In the case that the list of composed of barcodes, those barcodes should be passed though the item_barcode_transform plugin hook before the lookup is performed.
Created attachment 139945 [details] [review] Bug 31482i: Label creator does not call item_barcode_transform plugin hook The label creator can accept a list of either itemnumbers or item barcodes. In the case that the list of composed of barcodes, those barcodes should be passed though the item_barcode_transform plugin hook before the lookup is performed. 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) On the "New label batch" page of the Label creator,, type in some valid barcodes, but prefix them with X and postfix them with Y, e.g. X123456Y 5) Submit the form 6) Note the items are added to the label batch!
Created attachment 139946 [details] [review] Bug 31482: Label creator does not call item_barcode_transform plugin hook The label creator can accept a list of either itemnumbers or item barcodes. In the case that the list of composed of barcodes, those barcodes should be passed though the item_barcode_transform plugin hook before the lookup is performed. 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) On the "New label batch" page of the Label creator,, type in some valid barcodes, but prefix them with X and postfix them with Y, e.g. X123456Y 5) Submit the form 6) Note the items are added to the label batch!
Shouldn't this actually be a call to C4::Circulation::barcodedecode ?
(In reply to Joonas Kylmälä from comment #3) > Shouldn't this actually be a call to C4::Circulation::barcodedecode ? Good thinking! I'll post an updated patch asap.
Created attachment 139997 [details] [review] Bug 31482: Label creator does not call item_barcode_transform plugin hook The label creator can accept a list of either itemnumbers or item barcodes. In the case that the list of composed of barcodes, those barcodes should be passed though the item_barcode_transform plugin hook before the lookup is performed. 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) On the "New label batch" page of the Label creator,, type in some valid barcodes, but prefix them with X and postfix them with Y, e.g. X123456Y 5) Submit the form 6) Note the items are added to the label batch!
Need to move the barcodedecode call straight into Koha::Items->find(), it's not taking a reference but rather returning the decoded barcode.
Please update the patch description too
Created attachment 140036 [details] [review] Bug 31482: Label creator does not call barcodedecode The label creator can accept a list of either itemnumbers or item barcodes. In the case that the list of composed of barcodes, those barcodes should be passed though barcodedecode before the lookup is performed. 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) On the "New label batch" page of the Label creator,, type in some valid barcodes, but prefix them with X and postfix them with Y, e.g. X123456Y 5) Submit the form 6) Note the items are added to the label batch!
Created attachment 140051 [details] [review] Bug 31482: Label creator does not call barcodedecode The label creator can accept a list of either itemnumbers or item barcodes. In the case that the list of composed of barcodes, those barcodes should be passed though barcodedecode before the lookup is performed. 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) On the "New label batch" page of the Label creator,, type in some valid barcodes, but prefix them with X and postfix them with Y, e.g. X123456Y 5) Submit the form 6) Note the items are added to the label batch! JK: Remove unnecessary if $number check, barcodedecode already does this Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Fixed up the patch a little bit, removed "if $number" from the end as that was causing a bug with 0 barcodes and barcodedecode does it already. Signing off.
Created attachment 141114 [details] [review] Bug 31482: Label creator does not call barcodedecode The label creator can accept a list of either itemnumbers or item barcodes. In the case that the list of composed of barcodes, those barcodes should be passed though barcodedecode before the lookup is performed. 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) On the "New label batch" page of the Label creator,, type in some valid barcodes, but prefix them with X and postfix them with Y, e.g. X123456Y 5) Submit the form 6) Note the items are added to the label batch! JK: Remove unnecessary if $number check, barcodedecode already does this Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed to master for 22.11. Nice work everyone, thanks!
Backported to 22.05.x for upcoming 22.05.07 release
applied to 21.11 for 21.11.14
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document it seems, marking resolved.