MasonX::Request::WithApacheSession 0.30 bug: subrequests

Derek Poon <[email protected]> Sun, 10 Jul 2005 04:03:23 +0200
Newsgroups gmane.comp.web.mason.devel
Message-ID <[email protected]>
Hi,

There is a bug in MasonX::Request::WithApacheSession 0.30 that causes  
an error when executing subrequests.

I have this in my httpd.conf:

PerlSetVar MasonRequestClass MasonX::Request::WithApacheSession


When running  $m->subexec(...)  in Mason, I get this error in the  
browser:

error:
Can't call method "exec" on an undefined value at [...]/HTML/Mason/ 
Request.pm line 538, <GEN0> line 2.

Trace begun at [...]/HTML/Mason/Exceptions.pm line 128
HTML::Mason::Exceptions::rethrow_exception('Can\'t call method "exec"  
on an undefined value at [...]/HTML/Mason/Request.pm line 538, <GEN0>  
line 2.^J') called at [...]/HTML/Mason/Request.pm line 538
HTML::Mason::Request::subexec([...]) called at [...]/autohandler line 58
[...]


Here's the fix:

--- MasonX-Request-WithApacheSession-0.30/lib/MasonX/Request/ 
WithApacheSession.pm.subrequest    2004-03-19 23:27:55.000000000 +0100
+++ MasonX-Request-WithApacheSession-0.30/lib/MasonX/Request/ 
WithApacheSession.pm       2005-07-10 03:52:35.000000000 +0200
@@ -74,7 +74,7 @@
      my $self = $class->SUPER::new(@_);
-    return if $self->is_subrequest;
+    return $self if $self->is_subrequest;
      # backwards compatibility
      $self->{session_param_name} =



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar