From a86b7a063d21bf5a3b4537d4fd7219358befe1af Mon Sep 17 00:00:00 2001 From: nela Date: Sat, 26 Sep 2026 18:25:30 +0100 Subject: [PATCH] Bug 43650: incremental EAN-13 barcodes produce unexpected sequence When incremental EAN-13 barcodes are selected for autoBarcode and new item records are created an unexpected sequence of barcode numbers is produced instead of a sequence where the barcode is incremented by 1 between each item. This patch fixes that by adding quote marks in the inline JS, thus treating the barcode as a string rather than an integer :+) Test plan: 1. have records imported from somewhere but with no items 2. autoBarcode set to incremental EAN-13 barcodes 3. create a number of new items 4. observe that the item barcodes don't follow the expected sequence 5. apply patch 6. delete item records 7. repeat step 3 8. observe that the item barcodes follow the expected sequence Signed-off-by: David Cook Signed-off-by: Pedro Amorim --- cataloguing/value_builder/barcode.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cataloguing/value_builder/barcode.pl b/cataloguing/value_builder/barcode.pl index adbfea83db..8e005c8aee 100755 --- a/cataloguing/value_builder/barcode.pl +++ b/cataloguing/value_builder/barcode.pl @@ -77,7 +77,7 @@ if (\$('#' + id).val() == '' || force) { \$('#' + id).val(prefix + '-' + newNumberStr); } else if ( autobarcodetype == "EAN13" ) { - \$('#' + id).val(incrementEAN13($nextnum, offset)); + \$('#' + id).val(incrementEAN13('$nextnum', offset)); } else if ( incremental_barcode ) { \$('#' + id).val($nextnum + offset);