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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 12 Jul 2004 16:25:51 -0000


albertel		Mon Jul 12 12:25:51 2004 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  - BUG#3186, when doing redirection, need to turn metamode off, so that endriderection does actually get any interveing text.
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.327 loncom/xml/lonxml.pm:1.328
--- loncom/xml/lonxml.pm:1.327	Thu Jul  8 10:35:12 2004
+++ loncom/xml/lonxml.pm	Mon Jul 12 12:25:51 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.327 2004/07/08 14:35:12 sakharuk Exp $
+# $Id: lonxml.pm,v 1.328 2004/07/12 16:25:51 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -788,18 +788,26 @@
     }
 }
 
+my $metamode_was;
 sub startredirection {
-  $Apache::lonxml::redirection++;
-  push (@Apache::lonxml::outputstack, '');
+    if (!$Apache::lonxml::redirection) {
+	$metamode_was=$Apache::lonxml::metamode;
+    }
+    $Apache::lonxml::metamode=0;
+    $Apache::lonxml::redirection++;
+    push (@Apache::lonxml::outputstack, '');
 }
 
 sub endredirection {
-  if (!$Apache::lonxml::redirection) {
-    &Apache::lonxml::error("Endredirection was called, before a startredirection, perhaps you have unbalanced tags. Some debuging information:".join ":",caller);
-    return '';
-  }
-  $Apache::lonxml::redirection--;
-  pop @Apache::lonxml::outputstack;
+    if (!$Apache::lonxml::redirection) {
+	&Apache::lonxml::error("Endredirection was called, before a startredirection, perhaps you have unbalanced tags. Some debuging information:".join ":",caller);
+	return '';
+    }
+    $Apache::lonxml::redirection--;
+    if (!$Apache::lonxml::redirection) {
+	$Apache::lonxml::metamode=$metamode_was;
+    }
+    pop @Apache::lonxml::outputstack;
 }
 
 sub end_tag {