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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 03 Mar 2005 21:14:10 -0000


albertel		Thu Mar  3 16:14:10 2005 EDT

  Modified files:              
    /loncom/publisher	lonpublisher.pm 
  Log:
  - id=" was causing havoc (BUG#3993)
  
  
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.185 loncom/publisher/lonpublisher.pm:1.186
--- loncom/publisher/lonpublisher.pm:1.185	Mon Feb 28 16:28:18 2005
+++ loncom/publisher/lonpublisher.pm	Thu Mar  3 16:14:10 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.185 2005/02/28 21:28:18 www Exp $
+# $Id: lonpublisher.pm,v 1.186 2005/03/03 21:14:10 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -548,7 +548,8 @@
 	    my $counter;
 	    if ($counter=$addid{$token->[1]}) {
 		if ($counter eq 'id') {
-		    if (defined($token->[2]->{'id'})) {
+		    if (defined($token->[2]->{'id'}) &&
+			$token->[2]->{'id'} !~ /^\s*$/) {
 			$maxid=($token->[2]->{'id'}>$maxid)?$token->[2]->{'id'}:$maxid;
 			if (exists($allids{$token->[2]->{'id'}})) {
 			    $duplicateids=1;
@@ -560,7 +561,8 @@
 			$needsfixup=1;
 		    }
 		} else {
-		    if (defined($token->[2]->{'index'})) {
+		    if (defined($token->[2]->{'index'}) &&
+			$token->[2]->{'index'} !~ /^\s*$/) {
 			$maxindex=($token->[2]->{'index'}>$maxindex)?$token->[2]->{'index'}:$maxindex;
 		    } else {
 			$needsfixup=1;
@@ -674,13 +676,15 @@
 		if (!$counter) { $counter=$addid{$lctag}; }
 		if ($counter) {
 		    if ($counter eq 'id') {
-			unless (defined($parms{'id'})) {
+			unless (defined($parms{'id'}) &&
+				$parms{'id'}!~/^\s*$/) {
 			    $maxid++;
 			    $parms{'id'}=$maxid;
 			    print $logfile 'ID: '.$tag.':'.$maxid."\n";
 			}
 		    } elsif ($counter eq 'index') {
-			unless (defined($parms{'index'})) {
+			unless (defined($parms{'index'}) &&
+				$parms{'index'}!~/^\s*$/) {
 			    $maxindex++;
 			    $parms{'index'}=$maxindex;
 			    print $logfile 'Index: '.$tag.':'.$maxindex."\n";