[LON-CAPA-cvs] cvs: loncom /publisher lonpublisher.pm

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 12 Aug 2002 14:48:32 -0000


matthew		Mon Aug 12 10:48:32 2002 EDT

  Modified files:              
    /loncom/publisher	lonpublisher.pm 
  Log:
  Fix 2 bugs: put dates into sql format using &sqltime, like it used to.
  Used to only pick up checked keywords if there was more than one.
  
  
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.92 loncom/publisher/lonpublisher.pm:1.93
--- loncom/publisher/lonpublisher.pm:1.92	Fri Aug  9 15:49:30 2002
+++ loncom/publisher/lonpublisher.pm	Mon Aug 12 10:48:32 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.92 2002/08/09 19:49:30 albertel Exp $
+# $Id: lonpublisher.pm,v 1.93 2002/08/12 14:48:32 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1076,17 +1076,20 @@
      $metadatafields{'abstract'}=$ENV{'form.abstract'};
      $metadatafields{'mime'}=$ENV{'form.mime'};
      $metadatafields{'language'}=$ENV{'form.language'};
-     $metadatafields{'creationdate'}=$ENV{'form.creationdate'};
-     $metadatafields{'lastrevisiondate'}=$ENV{'form.lastrevisiondate'};
+     $metadatafields{'creationdate'}=
+         &sqltime($ENV{'form.creationdate'});
+     $metadatafields{'lastrevisiondate'}=
+         &sqltime($ENV{'form.lastrevisiondate'});
      $metadatafields{'owner'}=$ENV{'form.owner'};
      $metadatafields{'copyright'}=$ENV{'form.copyright'};
      $metadatafields{'dependencies'}=$ENV{'form.dependencies'};
 
      my $allkeywords=$ENV{'form.addkey'};
-     if (exists($ENV{'form.keywords'}) && (ref($ENV{'form.keywords'}))) {
-         my @Keywords = @{$ENV{'form.keywords'}};
-         foreach (@Keywords) {
-             $allkeywords.=','.$_;
+     if (exists($ENV{'form.keywords'})) {
+         if (ref($ENV{'form.keywords'})) {
+             $allkeywords .= ','.join(',',@{$ENV{'form.keywords'}});
+         } else {
+             $allkeywords .= ','.$ENV{'form.keywords'};
          }
      }
      $allkeywords=~s/\W+/\,/;