From 3a76621fdc9d50df2577630d2580efca426ac53c Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Mon, 29 Aug 2022 09:26:44 -0400 Subject: [PATCH] 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! --- labels/label-edit-batch.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/labels/label-edit-batch.pl b/labels/label-edit-batch.pl index ac2da6392f..02d23f8750 100755 --- a/labels/label-edit-batch.pl +++ b/labels/label-edit-batch.pl @@ -89,6 +89,7 @@ elsif ($op eq 'add') { push @item_numbers, $number; } elsif ($number_type eq "barcode" ) { # we must test in case an invalid barcode is passed in; we effectively disgard them atm + Koha::Plugins->call( 'item_barcode_transform', \$number ); my $item = Koha::Items->find({barcode => $number}); push @item_numbers, $item->itemnumber if $item; } -- 2.30.2