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

Bug #6110 invalid return value from callback is not handled when validating page
Submitted: 2005-11-29 17:41 UTC
From: akutin at symcor dot com Assigned: avb
Status: Closed Package: HTML_QuickForm_Controller
PHP Version: Irrelevant OS: Any
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 36 - 29 = ?

 
 [2005-11-29 17:41 UTC] akutin at symcor dot com
Description: ------------ If you add a form rule to a page and your callback function returns something but expected values true or array, the page validates successfully. Test script: --------------- class XPage extends HTML_QuickForm_Page { function buildForm() { $this->addElement( 'text', 'Test', 'Test'); $this->addFormRule( array( $this, 'checkIT')); // other elements } function checkIT( $fields) { // returns invalid value 'false' if Test is empty return strlen( $fields['Test']) != 0; } } in jump, back, next, direct, submit actions instead of $data['valid'][$pageName] = $page->validate(); should be if( PEAR::isError( $valid = $page->validate())) { return $valid; } $data['valid'][$pageName] = $valid; Expected result: ---------------- page does not validate, $controller->run() returns PEAR_Error. Actual result: -------------- the page is considered to be valid, $controller->run() returns true.

Comments

 [2006-02-26 18:31 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!
 [2006-05-31 08:59 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!