[Koha-bugs] [Bug 18088] New: Software error additem.pl Can' t call method subfield error. Can't add items.

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Feb 9 11:40:19 CET 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18088

            Bug ID: 18088
           Summary: Software error additem.pl Can't call method subfield
                    error. Can't add items.
 Change sponsored?: ---
           Product: Koha
           Version: 16.11
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Cataloging
          Assignee: gmcharlt at gmail.com
          Reporter: hard359 at gmail.com
        QA Contact: testopia at bugs.koha-community.org
                CC: m.de.rooy at rijksmuseum.nl

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;
}

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list