Menu

#1 validating & www_modify

open
None
5
2001-06-28
2001-06-26
Lee Weston
No

www_modify does not work right with validation / error
checking.

www_save usually ends something like (this is from
Gizmo.pm)

if ($errormsg) {
$self->www_modify($errormsg);
} else {
$self->save();

#$self->md_redirect("http://$GA{basename}/index.pl?iid=".$self->parent_id);
$self->md_redirect($url);
}

The commented out line is metadot.com's, presumably so
one can edit from a category or the detail. (I use it
a little bit harder, but in the same vain).

The trouble comes in if you do validation on a Gizmo
form and have an error message to display. You go back
into the form (displaying the error message) for the
user to fix things.

... but second time around $url points not to where you
really started, but to the previous modify

In Gizmo.pm
In sub www_modify {

my $target = $SESSION->{referer};

and later

<input type='hidden' name='target' value='$target'>

-----------

it seems to me the assignment line should be

my $target = $FORM{$target} || $SESSION->{referer};

or to avoid upsetting mod_perl

my $target
=defined($FORM{$target})?$FORM{$target}:$SESSION->{referer};

Discussion

  • David Sheth

    David Sheth - 2001-06-28
    • assigned_to: nobody --> cgarcia
     
  • David Sheth

    David Sheth - 2001-06-28

    Logged In: YES
    user_id=106430

    We will evalute, and add the fix to 3.2, and possibly the
    3.1 branch.

     

Log in to post a comment.