[Koha] addbiblio.pl still failing

linda r lindamarcella at yahoo.com
Tue Aug 21 08:44:57 NZST 2007


The last error from the end of /var/log/apache2/error.log is:

Arguments must be MARC::Field object at
/usr/local/koha/intranet/modules/C4/Biblio.pm line 1440.

Line 1440 of C4/Biblio.pm is here in NEWnewbiblio() (see below). 
NEWnewbiblio() might be called from line 529 of
/usr/local/koha/intranet/cgi-bin/acqui.simple/addbiblio.pl because grepping
for NEWnewbiblio in cgi-bin and its subdirectories reveals only one result
there.

This time I did not go through the incomplete required field error; I filled
in the MARC tag 003 field with the number "1" before pressing the "add
biblio" button.  I also fixed an error where I had a bad Z3950 server
database.  I don't know if that was the reason, but I doubt it.

I don't know if the last message in the apache error log was a warning or
fatal.  Some of the messages seem to be just warnings.

Would it help anyone if I put print statements in?

Thanks,

Linda

1345 sub NEWnewbiblio {
...

1387     # we must add bibnum and bibitemnum in MARC::Record...
1388     # we build the new field with biblionumber and biblioitemnumber
1389     # we drop the original field
1390     # we add the new builded field.
1391 # NOTE : Works only if the field is ONLY for biblionumber and
biblioitemnumber
1392     # (steve and paul : thinks 090 is a good choice)
1393     my $sth =
1394       $dbh->prepare(
1395 "select tagfield,tagsubfield from marc_subfield_structure where
kohafield=?"
1396     );
1397     $sth->execute("biblio.biblionumber");
1398     ( my $tagfield1, my $tagsubfield1 ) = $sth->fetchrow;
1399     $sth->execute("biblioitems.biblioitemnumber");
1400     ( my $tagfield2, my $tagsubfield2 ) = $sth->fetchrow;
1401     my $newfield;
1402     # biblionumber & biblioitemnumber are in different fields
1403     if ( $tagfield1 != $tagfield2 ) {
1404         # deal with biblionumber
1405         if ($tagfield1<10) {
1406             $newfield = MARC::Field->new(
1407                 $tagfield1, $oldbibnum,
1408             );
1409         } else {
1410             $newfield = MARC::Field->new(
1411                 $tagfield1, '', '', "$tagsubfield1" => $oldbibnum,
1412             );
1413         }
1414         # drop old field and create new one...
1415         my $old_field = $record->field($tagfield1);
1416         $record->delete_field($old_field);
1417         $record->add_fields($newfield);
1418         # deal with biblioitemnumber
1419         if ($tagfield2<10) {
1420             $newfield = MARC::Field->new(
1421                 $tagfield2, $oldbibitemnum,
1422             );
1423         } else {
1424             $newfield = MARC::Field->new(
1425                 $tagfield2, '', '', "$tagsubfield2" => $oldbibitemnum,
1426             );
1427         }
1428         # drop old field and create new one...
1429         $old_field = $record->field($tagfield2);
1430         $record->delete_field($old_field);
1431         $record->add_fields($newfield);
1432     # biblionumber & biblioitemnumber are in the same field (can't be
<10 as fields <10 have only 1 value)
1433     } else {
1434         my $newfield = MARC::Field->new(
1435             $tagfield1, '', '', "$tagsubfield1" => $oldbibnum,
1436             "$tagsubfield2" => $oldbibitemnum
1437         );
1438         # drop old field and create new one...
1439         my $old_field = $record->field($tagfield1);
1440         $record->delete_field($old_field);
1441         $record->add_fields($newfield);
1442     }
1443 #   warn "REC : ".$record->as_formatted;
1444     my $bibid = MARCaddbiblio( $dbh, $record, $oldbibnum,
$frameworkcode );
1445     return ( $bibid, $oldbibnum, $oldbibitemnum );
1446 }



-- 
View this message in context: http://www.nabble.com/addbiblio.pl-still-failing-tf4236861.html#a12243610
Sent from the Koha - Discuss mailing list archive at Nabble.com.



More information about the Koha mailing list