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

Joshua Ferraro jmf at kados.org
Tue Oct 3 21:23:34 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Joshua Ferraro <kados>	06/10/03 19:23:34

Modified files:
	C4             : Biblio.pm 

Log message:
	had to change back to add_fields because insert_fields_ordered expects
	a MARC::Field object ... I'll fix this soon.

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.33&r2=1.115.2.51.2.34

Patches:
Index: Biblio.pm
===================================================================
RCS file: /sources/koha/koha/C4/Biblio.pm,v
retrieving revision 1.115.2.51.2.33
retrieving revision 1.115.2.51.2.34
diff -u -b -r1.115.2.51.2.33 -r1.115.2.51.2.34
--- Biblio.pm	3 Oct 2006 14:29:57 -0000	1.115.2.51.2.33
+++ Biblio.pm	3 Oct 2006 19:23:34 -0000	1.115.2.51.2.34
@@ -1335,32 +1335,27 @@
 =cut
 
 sub MARCkoha2marcOnefield {
-    my ( $sth, $record, $kohafieldname, $value,$frameworkcode ) = @_;
+    my ( $sth,$record,$kohafieldname,$value,$frameworkcode ) = @_;
     my $tagfield;
     my $tagsubfield;
 
-if (!defined $sth){
-my $dbh=C4::Context->dbh;
-$sth =
-      $dbh->prepare(
-"select tagfield,tagsubfield from marc_subfield_structure where frameworkcode=? and kohafield=?"
+	if (!defined $sth){
+		my $dbh=C4::Context->dbh;
+		$sth = $dbh->prepare(
+			"select tagfield,tagsubfield from marc_subfield_structure where frameworkcode=? and kohafield=?"
     );
-}
+	}
     $sth->execute($frameworkcode,$kohafieldname);
     if ( ( $tagfield, $tagsubfield ) = $sth->fetchrow ) {
- #       if ( $record->field($tagfield) ) {
             my $tag = $record->field($tagfield);
         if ($tag) {
                 $tag->update( $tagsubfield=> $value );
                 $record->delete_field($tag);
                 $record->insert_fields_ordered($tag);
-
-            
         } else {
-            $record->insert_fields_ordered( $tagfield, " ", " ", $tagsubfield => $value );
+            $record->add_fields( $tagfield, " ", " ", $tagsubfield => $value );
         }
     }
-
     return $record;
 }
 
@@ -3146,8 +3141,12 @@
 
 =cut
 
-# $Id: Biblio.pm,v 1.115.2.51.2.33 2006/10/03 14:29:57 kados Exp $
+# $Id: Biblio.pm,v 1.115.2.51.2.34 2006/10/03 19:23:34 kados Exp $
 # $Log: Biblio.pm,v $
+# Revision 1.115.2.51.2.34  2006/10/03 19:23:34  kados
+# had to change back to add_fields because insert_fields_ordered expects
+# a MARC::Field object ... I'll fix this soon.
+#
 # Revision 1.115.2.51.2.33  2006/10/03 14:29:57  kados
 # Changing name of MARCgetbiblio2 to &GetMARCFromBiblioitems
 # It should be moved to Search.pm





More information about the Koha-cvs mailing list