fix record->field call on autobarcode
authorRyan Higgins <rch@balrog.liblime.com>
Thu, 10 Jan 2008 21:18:19 +0000 (15:18 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Thu, 10 Jan 2008 21:36:18 +0000 (15:36 -0600)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
serials/serials-edit.pl

index e0d6666..93cf630 100755 (executable)
@@ -227,12 +227,12 @@ if ($op eq 'serialchangestatus') {
             my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode");
             if (C4::Context->preference("autoBarcode") ne  'OFF'  ) {
               eval {    $record->field($tagfield)->subfield($tagsubfield) };
-              if ($@) {
+                 if ($@) {
                 my $sth_barcode = $dbh->prepare("select max(abs(barcode)) from items");
                 $sth_barcode->execute;
                 my ($newbarcode) = $sth_barcode->fetchrow;
                 # OK, we have the new barcode, add the entry in MARC record # FIXME -> should be  using barcode plugin here.
-                $field->update( $tagsubfield => ++$newbarcode );
+                $record->field($tagfield)->update( $tagsubfield => ++$newbarcode );
               }
             }
             # check for item barcode # being unique