From 28373da792d23f5904ae9190c5eb13d52d1d97b1 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. --- serials/serials-edit.pl | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl index 66d3a4e..34f1031 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'); -- 1.7.2.5