Re: HTML_QuickForm_Controller and setDefaults
| From: | Alexey Borzov | Date: | Wed, 13 Sep 2006 20:40:51 +0000 |
| Subject: | Re: HTML_QuickForm_Controller and setDefaults | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25131@lists.php.net to get a copy of this message | ||
Hi,
Kim Fredenberg wrote:
Seems like this change will indeed fix the problem, though I need to check whether it can also break something else. :]When running special case code to check form-pages that weren't seen by users (lines 243-259 of Controller.php), such forms erroneously consider themselves submitted. Thus defaults for checkboxes and (probably) multiple selects are not used.That seems to be the case. So the submit value is set instead of the default one, which is empty since the page hasn't been seen. I did a really dirty one and it made the checkboxes work (and everything else as well), I set $page->_flagSubmitted = false; on line 245 in Controller.php Now I am happy, it works like a charm :)
I don't know if this is the way to fix it, probably the setting of _flagSubmitted should be avoided somewhere else. Probably a bug should be opened, should I do it or?Yes, please do open the bug.