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

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 17 Apr 2002 16:21:47 -0000


matthew		Wed Apr 17 12:21:47 2002 EDT

  Modified files:              
    /loncom/publisher	lonpublisher.pm 
  Log:
  No longer crash when there are no keywords.
  
  
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.77 loncom/publisher/lonpublisher.pm:1.78
--- loncom/publisher/lonpublisher.pm:1.77	Sun Apr 14 12:25:39 2002
+++ loncom/publisher/lonpublisher.pm	Wed Apr 17 12:21:46 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.77 2002/04/14 16:25:39 matthew Exp $
+# $Id: lonpublisher.pm,v 1.78 2002/04/17 16:21:46 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -714,9 +714,11 @@
      $metadatafields{'dependencies'}=$ENV{'form.dependencies'};
 
      my $allkeywords=$ENV{'form.addkey'};
-     my @Keywords = @{$ENV{'form.keywords'}};
-     foreach (@Keywords) {
-         $allkeywords.=','.$_;
+     if (exists($ENV{'form.keywords'})) {
+         my @Keywords = @{$ENV{'form.keywords'}};
+         foreach (@Keywords) {
+             $allkeywords.=','.$_;
+         }
      }
      $allkeywords=~s/\W+/\,/;
      $allkeywords=~s/^\,//;