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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 10 Nov 2005 21:38:32 -0000


albertel		Thu Nov 10 16:38:32 2005 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  - Apache->request doesn't work unde mod_perl 2...
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.387 loncom/xml/lonxml.pm:1.388
--- loncom/xml/lonxml.pm:1.387	Thu Nov 10 16:28:21 2005
+++ loncom/xml/lonxml.pm	Thu Nov 10 16:38:27 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.387 2005/11/10 21:28:21 albertel Exp $
+# $Id: lonxml.pm,v 1.388 2005/11/10 21:38:27 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1456,7 +1456,12 @@
     if ($Apache::lonxml::debug eq "1") {
 	$|=1;
 	my $request=$Apache::lonxml::request;
-	if (!$request) { $request=Apache->request; }
+	if (!$request) {
+	    eval { $request=Apache->request; };
+	}
+	if (!$request) {
+	    eval { $request=Apache2::RequestUtil->request; };
+	}
 	$request->print('<font size="-2"><pre>DEBUG:'.&HTML::Entities::encode($_[0],'<>&"')."</pre></font>\n");
 	#&Apache::lonnet::logthis($_[0]);
     }