[cgiapp] CGI Params lost during forward?

jerry jerry at tr2.com
Mon Sep 7 19:16:57 EDT 2015


Whups, it was a bug in my own code.  One of those things that you stare
at all day, and it's Obviously Right.  Except that it Wasn't :).  All
contexts and variables are preserved across $self->forward().

                       - Jerry


On 09/07/2015 07:48, jerry wrote:
> Hello,
> 
>     I have been making good use of the cgiapp "forward" functionality (
> in CGI::Application::Plugin::Forward ).  Basically, I'll have a summary
> screen of some sort, and an action button - click the action button, 
> the
> system does
> something special, then forward back to the summary screen.
> 
>     That works well. But I just tried something different - from a 
> child
> screen ( which needs some context to know which child screen to display
> ) I called $self->forward() after doing something special in that child
> screen.  After that something special, the child screen bombed because
> its context was gone.
> 
>    That context ( really just an ID variable ) disappeared when I 
> called
> $self->forward( 'CHILD_SCREEN_RM' ).  In other words -
> $cgi_params{CHILD_ID_VARIABLE} was now undefined.
> 
>    Is this how it's supposed to work?  Do CGI variables disappear 
> during
> a forward()?  If so, it'll make my life a little complicated, because
> I'll have to have code in the individual rm's ( which might be called
> from a forward() to check to see if the CGI variables still work....
> 
>    Or is it just that a new context is created by the forward, and I 
> need
> to
> do another new CGI object inside the rm to re-snarf everything?
> 
>    I just thought I'd ask before I do a TCAITIW ( Throw Code At It Till
> It Works ) :).
> 
> 
>    Thanks in advance,
> 
>            - Jerry Kaidor
> 
> 
> 
> #####  CGI::Application community mailing list  ################
> ##                                                            ##
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
> ##                                                            ##
> ##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
> ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> ##                                                            ##
> ################################################################



More information about the cgiapp mailing list