From d9c39688bcc5f4064763d8e2a6958c94066dbdd8 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 (cherry picked from commit 1d9ac2b10a96800d301524978f00ee393b5bb75e) Signed-off-by: Bernardo Gonzalez Kriegel (cherry picked from commit 1d9ac2b10a96800d301524978f00ee393b5bb75e) --- 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 bb87c5f922..2d5ee79acb 100755 --- a/serials/serials-edit.pl +++ b/serials/serials-edit.pl @@ -317,8 +317,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