From 0cd0ea6fa827b3d6b95bf865a2afb03557ec71a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Mon, 3 Dec 2018 18:27:08 +0100 Subject: [PATCH] Bug 21937: Syspref autoBarcode annual doesn't increment properly barcode in some cases This patch show the issue. If the DB contains a barcode (not auto attributed by Koha) which begin with the year used to generate automatically a new one, there may be a 'collision'. prove -v t/db_dependent/Barcodes_ValueBuilder.t Signed-off-by: Michal Denar Signed-off-by: Michal Denar --- t/db_dependent/Barcodes_ValueBuilder.t | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t/db_dependent/Barcodes_ValueBuilder.t b/t/db_dependent/Barcodes_ValueBuilder.t index a116b45565..7573bbd0da 100644 --- a/t/db_dependent/Barcodes_ValueBuilder.t +++ b/t/db_dependent/Barcodes_ValueBuilder.t @@ -49,6 +49,12 @@ my $item_2 = $builder->build({ my $item_3 = $builder->build({ source => 'Item', value => { + barcode => '201200345' + } +}); +my $item_4 = $builder->build({ + source => 'Item', + value => { barcode => '2012-0034' } }); -- 2.11.0