[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm

albertel lon-capa-cvs-allow@mail.lon-capa.org
Mon, 14 May 2007 08:42:15 -0000


albertel		Mon May 14 04:42:15 2007 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  - prevent some uninitialized warnings
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.444 loncom/xml/lonxml.pm:1.445
--- loncom/xml/lonxml.pm:1.444	Mon Apr 16 14:47:46 2007
+++ loncom/xml/lonxml.pm	Mon May 14 04:42:13 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.444 2007/04/16 18:47:46 albertel Exp $
+# $Id: lonxml.pm,v 1.445 2007/05/14 08:42:13 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1744,10 +1744,12 @@
     
     # parse the allows and ignore tags set to <show>no</show>
     foreach my $tag (@alltags) {	
+        next if (!exists($insertlist{"$tag.allow"}));
 	my $allow =  $insertlist{"$tag.allow"};
        	foreach my $element (split(',',$allow)) {
 	    $element =~ s/(^\s*|\s*$ )//gx;
-	    if ($insertlist{"$element.show"} ne 'no') {
+	    if (exists($insertlist{"$element.show"})
+                && $insertlist{"$element.show"} ne 'no') {
 		push(@{ $insertlist{$tag.'.which'} },$element);
 	    }
 	}