From 1d9ac2b10a96800d301524978f00ee393b5bb75e Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 17 Jun 2013 12:28:13 -0400 Subject: [PATCH] Bug 10484: serials-edit.pl not checking for barcode field before checking for barcode subfield The script serials-edit.pl is not checking for the existence of the barcode field before checking for barcode subfield for autoBarcode = incremental. If the barcode field doesn't exist, the script dies with errors. Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer Passes tests and QA script. Checked that adding items on serial receive still works. Signed-off-by: Galen Charlton (cherry picked from commit 9af08e4e2d2091de489633b3f1c4fb03fcf323cd) Signed-off-by: Tomas Cohen Arazi --- serials/serials-edit.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl index 66d3a4eedd..34f10316f6 100755 --- a/serials/serials-edit.pl +++ b/serials/serials-edit.pl @@ -318,8 +318,12 @@ if ( $op and $op eq 'serialchangestatus' ) { if ( C4::Context->preference('autoBarcode') eq 'incremental' ) { - if ( !$bib_record->field($barcodetagfield) - ->subfield($barcodetagsubfield) ) + if ( + !( + $bib_record->field($barcodetagfield) + && $bib_record->field($barcodetagfield)->subfield($barcodetagsubfield) + ) + ) { my $sth_barcode = $dbh->prepare( 'select max(abs(barcode)) from items'); -- 2.39.5