--- loncom/metadata_database/LONCAPA/lonmetadata.pm 2005/03/11 03:25:18 1.12 +++ loncom/metadata_database/LONCAPA/lonmetadata.pm 2005/11/29 19:56:42 1.13 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonmetadata.pm,v 1.12 2005/03/11 03:25:18 matthew Exp $ +# $Id: lonmetadata.pm,v 1.13 2005/11/29 19:56:42 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -483,6 +483,15 @@ sub metadata_col_to_hash { my %hash=(); for (my $i=0; $i<=$#Metadata_Table_Description;$i++) { $hash{$Metadata_Table_Description[$i]->{'name'}}=$cols[$i]; + unless ($hash{$Metadata_Table_Description[$i]->{'name'}}) { + if ($Metadata_Table_Description[$i]->{'type'} eq 'TEXT') { + $hash{$Metadata_Table_Description[$i]->{'name'}}=''; + } elsif ($Metadata_Table_Description[$i]->{'type'} eq 'DATETIME') { + $hash{$Metadata_Table_Description[$i]->{'name'}}='0000-00-00 00:00:00'; + } else { + $hash{$Metadata_Table_Description[$i]->{'name'}}=0; + } + } } return %hash; }