I was able to resolve my problem today through a little more time and patience.
 
I am wondering if my problem *was* related to the mason/obj folder, or a bug in Mason 1.28?  Before emailing the list, I had the following in my sessions.mpl:
 
[#1] $page_content = $m->scomp($m->fetch_next, toptext => $toptext);
 
..and alas it wasn't working, so then I switched it to:
 
[#2] $page_content = $m->scomp($m->fetch_next, %ARGS);
 
dumb idea.. OK - Long story short.. I switched it back to #1 and still wasn't working.
 
SOLUTION: * Finally, I stopped apache, did an 'rm -rf mason/obj/*', and then restarted Apache to resolve the problem. *
 
I am running Mason 1.28 with mod_perl 1.29 under Apache 1.3.34 w/ APXS.  I always compile Apache and everything from source and build in everything as DSO.
 
Can anyone confirm whether or not this is a bug and if it has been resolved in later releases of Mason?
 
 
On a final note, I am now $m->scomp($m->fetch_next, toptext => $toptext, %ARGS);
 
Kris
----- Original Message -----
From: Kris Yates
Sent: Wednesday, February 01, 2006 11:37 AM
Subject: [Mason] problem with method defining and passing %ARGS

I have a problem where a method defines a variable but it isn't passing to the next component.  I'm not sure what to do at this point, I have spent a couple of days on this and dont know what else to try.  Obviously, there is something I have missed or otherwise do not understand clearly.  Hoping someone will be kind enough to help.  I am not new to coding but have only been working with mason a couple of months in my spare time.
 
At the top of every page of my test site, there is a simple username/password login form, and submit button.  When someone submits the form, autohandler loads a session.mpl module which then loads index.html.
 
I am trying to define a $var in session and pass it to index.  I am showing that it is being defined, however, index.html never gets it.  Totally puzzling.
 

init section of autohandler contains:
 
my $reqargs = $m->request_args;
my $mode = $reqargs->{mode};
if($mode eq 'login-submit'){
        $page_content = $m->comp('session.mpl:login', %ARGS);
        }
else{
        $page_content = $m->scomp($m->fetch_next, %ARGS);
        }
 
OK, when someone submits a username password with login form, mode == 'login-submit'.
 
* session.mpl is successfully receiving %ARGS with username and password.
* session.mpl successfully defines $toptext but does not seem to pass it to index.html.
 
.. from session.mpl:
 
if($password eq undef){ $toptext = 'Invalid Password'; }
 
I also have $toptext => undef in my %args section of the session:login method.
 
so finally, session.mpl loads the next component (index.html):
 
$page_content = $m->scomp($m->fetch_next, %ARGS);
return $page_content;
 
%ARGS should contain $toptext => 'Invalid Password' at this point.
 
$page_content is then displayed by autohandler.
 
if I return $toptext, I am seeing it is being defined as expected.  Why isnt index.html grabbing the ARG??
 
The only problem is that I am defining $toptext but it never displays in index.html.  I dont understand.  Everything says you can define a $var in a module and pass it on but I'm not sure why it isnt working for me... let me know how I can help you help me.
The only thing left to say is ARGH! in a frustrated pirate sorta voice. :)
 
Much thanks for any assistance,
 
Kris
 


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.25/247 - Release Date: 1/31/2006

Reply via email to