Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.2.16

Bug #243 Syntax Error in Global Validation Rules
Submitted: 2003-11-14 09:36 UTC
From: imho at auspantheon dot com Assigned:
Status: Bogus Package: HTML_QuickForm
PHP Version: Irrelevant OS: n/a
Roadmaps: (Not assigned)    
Subscription  


 [2003-11-14 09:36 UTC] imho at auspantheon dot com
Description: ------------ On line 1290, the line: $this->_errors += $res; I believe it should be: =+ Resulting Error: Fatal error: Unsupported operand types in /usr/share/pear/HTML/QuickForm.php on line 1290 Reproduce code: --------------- This error can be reproduced by submitting to the page where the form was constructed,using a form which doesn't contain a required element.

Comments

 [2003-11-14 09:44 UTC] imho at auspantheon dot com
I don't know why =+ fixes the problem, but it does cause problems in normal QuickForm use. I do not know the solution, I'll leave that to the developers. As for the expected behaviour, I would expect the QuickForm to trigger the 'required' rule and display appropriatly. Thanks for your time.
 [2003-11-14 12:39 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2003-11-15 00:35 UTC] imho at auspantheon dot com
<? function _is_student($fields) { if (!isset($fields['student'])) return false; if (in_array($fields['student'], $this->_students)) return true; return array('student' => 'No such student found.'); } ?> Above is my custom function, a var_dump of $res ($this->_errors += $res;) shows that when $res is false (as returned by my function when $fields['student'] does not exist) will crash the script. I'm sorry if you feel I'm wasting your time, however your rudeness is not appreciated. As for an "obviously broken" fix, The line (if ($res === false) continue;) added into the loop above ($this->_errors += $res;) seems to fix the problem, and displays the expected result.
 [2003-11-15 08:39 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!