While adding items it sais: Can't call method "subfield" on an undefined value at /usr/share/koha/intranet/cgi-bin/cataloguing/additem.pl line 91. Line 88 to 103 sub _increment_barcode { my ($record, $frameworkcode) = @_; my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode); unless ($record->field($tagfield)->subfield($tagsubfield)) { my $sth_barcode = $dbh->prepare("select max(abs(barcode)) from items"); $sth_barcode->execute; my ($newbarcode) = $sth_barcode->fetchrow; $newbarcode++; # OK, we have the new barcode, now create the entry in MARC record my $fieldItem = $record->field($tagfield); $record->delete_field($fieldItem); $fieldItem->add_subfields($tagsubfield => $newbarcode); $record->insert_fields_ordered($fieldItem); } return $record; }
Is items.barcode mapped to a MARC field in your frameworks? You can check on the Koha 2 MARC configuration page.