[Koha-cvs] koha/C4 Biblio.pm [dev_week]

Joshua Ferraro jmf at kados.org
Mon Sep 25 01:59:29 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Joshua Ferraro <kados>	06/09/24 23:59:29

Modified files:
	C4             : Biblio.pm 

Log message:
	turned on warnings, did some cleaning based on warns. Will turn off
	before release.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Biblio.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.115.2.51.2.28&r2=1.115.2.51.2.29

Patches:
Index: Biblio.pm
===================================================================
RCS file: /sources/koha/koha/C4/Biblio.pm,v
retrieving revision 1.115.2.51.2.28
retrieving revision 1.115.2.51.2.29
diff -u -b -r1.115.2.51.2.28 -r1.115.2.51.2.29
--- Biblio.pm	24 Sep 2006 23:33:07 -0000	1.115.2.51.2.28
+++ Biblio.pm	24 Sep 2006 23:59:29 -0000	1.115.2.51.2.29
@@ -18,6 +18,8 @@
 # Suite 330, Boston, MA  02111-1307 USA
 
 use strict;
+use warnings; no warnings 'uninitialized';
+
 require Exporter;
 use C4::Context;
 use C4::Database;
@@ -390,7 +392,7 @@
 sub ModItem {
     my ( $dbh, $record, $biblionumber, $itemnumber, $delete ) = @_;
 
-    &MARCmoditem( $dbh, $record, $bilionumber, $itemnumber, $delete );
+    &MARCmoditem( $dbh, $record, $biblionumber, $itemnumber, $delete );
     my $frameworkcode=MARCfind_frameworkcode($dbh,$biblionumber);
     my $olditem = MARCmarc2koha( $dbh, $record,$frameworkcode );
     _koha_modify_item( $dbh, $olditem );
@@ -457,7 +459,7 @@
     return $error if $error;
 
     # delete biblioitems and items from Koha tables and save in deletedbiblioitems,deleteditems
-    my $sth = $dbh->prepare("SELECT biblioitemnumber FROM biblioitems WHERE biblionumber=?");
+    $sth = $dbh->prepare("SELECT biblioitemnumber FROM biblioitems WHERE biblionumber=?");
     $sth->execute($biblionumber);
     while ( my $biblioitemnumber = $sth->fetchrow ) {
 
@@ -741,8 +743,9 @@
      foreach my $field (@fields) {
 	  $newrec->append_fields($field);
 	}
-	my $biblionumber=&MARCaddbiblio($dbh,$newrec,$biblionumber);
-    return $biblionumber;
+	# FIXME: should we be making sure the biblionumbers are the same?
+	my $newbiblionumber=&MARCaddbiblio($dbh,$newrec,$biblionumber);
+    return $newbiblionumber;
 }
 
 =head2 MARCgetbiblio
@@ -1362,7 +1365,6 @@
 
 sub MARChtml2xml {
 	my ($tags,$subfields,$values,$indicator,$ind_tag) = @_;        
-	#use MARC::File::XML;
 	my $xml= MARC::File::XML::header('UTF-8'); 
 	#$xml =~ s/UTF-8/ISO-8859-1/;
     my $prevvalue;
@@ -1381,9 +1383,16 @@
 			#warn "IND:".substr(@$indicator[$j],0,1).substr(@$indicator[$j],1,1)." ".@$tags[$i];
 			if (!$first){
 		    	$xml.="</datafield>\n";
-				if ((@$tags[$i] > 10) && (@$values[$i] ne "")){
+				if ((@$tags[$i] && @$tags[$i] > 10)  && (@$values[$i] ne "")){
 						my $ind1 = substr(@$indicator[$j],0,1);
-                        my $ind2 = substr(@$indicator[$j],1,1);
+						my $ind2;
+						if (@$indicator[$j]) {
+                        	$ind2 = substr(@$indicator[$j],1,1);
+						} 
+						else {
+							warn "Indicator is empty";
+							$ind2 = " ";
+						}
                         $xml.="<datafield tag=\"@$tags[$i]\" ind1=\"$ind1\" ind2=\"$ind2\">\n";
                         $xml.="<subfield code=\"@$subfields[$i]\">@$values[$i]</subfield>\n";
                         $first=0;
@@ -3131,8 +3140,12 @@
 
 =cut
 
-# $Id: Biblio.pm,v 1.115.2.51.2.28 2006/09/24 23:33:07 kados Exp $
+# $Id: Biblio.pm,v 1.115.2.51.2.29 2006/09/24 23:59:29 kados Exp $
 # $Log: Biblio.pm,v $
+# Revision 1.115.2.51.2.29  2006/09/24 23:59:29  kados
+# turned on warnings, did some cleaning based on warns. Will turn off
+# before release.
+#
 # Revision 1.115.2.51.2.28  2006/09/24 23:33:07  kados
 # renaming the remaining OLD subs to _koha_*
 #





More information about the Koha-cvs mailing list