[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cgiapp
Subject:    Re: [cgiapp] patch for recursive use of CAP::ValidateRM
From:       Graham TerMarsch <cgi-application () howlingfrog ! com>
Date:       2007-09-02 4:23:09
Message-ID: 200709012123.10212.cgi-application () howlingfrog ! com
[Download RAW message or body]

On Friday 31 August 2007 12:47 pm, George Hartzell wrote:
> Graham TerMarsch writes:
>  > sub processMypage {
>  >     my $self = shift;
>  >     # validate, showing error if invalid
>  >     my $res = $self->check_rm( 'mypage',
>  >         { 'required' => [qw( widget )],
>  >           'defaults' => {
>  >               'widget' => 1,
>  >           },
>  >           'constraint_methods' => {
>  >               'widget' => FV_num_int(),
>  >           },
>  >           'msgs' => {
>  >               'any_errors' => 'dfv_errors',
>  >               'prefix' => 'err_',
>  >           },
>  >         } );
>  >     unless ($res) {
>  >         return $self->check_rm_error_page();
>  >     }
>  >     # data ok, show form again.
>  >     return $self->showMypage();
>  > }
>
> This suffers from the same problem that's been biting me, you've just
> added another level of indirection.
>
>   mypage gets called and sees the submit_button
>
>   it calls processMypage, which check_rm's, see's the bad value and
>   calls check_rm_error_page, which points back to mypage
>
>   mypage gets called and sees the submit_button

Sorry, that should've been "showMyPage" in the call to "check_rm()" above.

Switching it to "showMyPage" causes -just- the redisplay of the page, without 
the check for 'submit_button' which creates the recursive problem.

-- 
Graham TerMarsch

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: cgiapp-unsubscribe@lists.erlbaum.net
For additional commands, e-mail: cgiapp-help@lists.erlbaum.net

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic