Re: Re: DO Formbuilder: crosslinks (checkboxes) Problem solved !! ?
| From: | Justin Patrin | Date: | Mon, 06 Dec 2004 19:06:48 +0000 |
| Subject: | Re: Re: DO Formbuilder: crosslinks (checkboxes) Problem solved !! ? | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16053@lists.php.net to get a copy of this message | ||
On Mon, 6 Dec 2004 14:20:45 +0100, Alexander Petri <alex.petri@gmx.de> wrote:
> i pointed out another error:
> if you have a crosslink, the value "checked" is not setted by the method
> setDefaults
> there is an array $selected_options which is directly from the DB
> and is putted directly into the method _createCheckbox
> so it works like setConstants i guess...
>
> but Justin Patrin wrote:
> "Leaving a POST in the browser history can easily cause problems"
>
> i dont know really what this means, or if it is a problem for my thoughts to
> solve
> the "crosslink Problem"
>
Well, you are right that what we have is a bug and your $key idea
sounds like it fixes it (thanks!).
What I meant is that it is always a good idea to do a
header('Location: http://example.com/page.php'); after a POST is
processed. That way, the user can't click "back" and re-post the data.
> "Alexander Petri" <alex.petri@gmx.de> schrieb im Newsbeitrag
> news:20041206123756.2383.qmail@pb1.pair.com...
>
>
> > The Problem was
> > if you do a submit on a form with crosslinks
> > and you want to show the form again (direct after it is submitted)
> > you will recognize that the "checked"-value on crosslinks are lost...
> > (i described the problem a short time ago in this mailing list)
> >
> >
> > Now i hope i solved this Problem:
> > in file DB/DataObject/FormBuilder.php Linie (around) 962
> > i changed this line:
> >
> > $crossLinksElement = $this->_createCheckbox($groupName.'[]', $value, $key,
> > in_array($key, $selected_options));
> >
> > to this line:
> >
> > $crossLinksElement =
> > $this->_createCheckbox($groupName.'['.$key.']',
> $value,
> > $key, in_array($key, $selected_options));
> >
> > note this: '['.$key.']'
> >
> > now it seems to work...
> > it would be great to update the whole class if there are no side
> effects...
> >
> > another point are triple links LINE (around)1041
> >
> > $tripleLinksElement = $this->_createCheckbox('__tripleLink_' .
> > $tripleLink['table'] . '[' . $key1 . '][]',
> >
> > i guess there should be also:
> >
> > $tripleLinksElement = $this->_createCheckbox('__tripleLink_' .
> > $tripleLink['table'] . '[' . $key1 .
> > ']['.$key2.']',
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> !DSPAM:41b464ea175525685761731!
>
>
--
Justin Patrin