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

Bug #1487 [Feature Request] NOTNULL fields should have a required rule
Submitted: 2004-05-24 19:57 UTC
From: justinpatrin Assigned: mw21st
Status: Closed Package: DB_DataObject_FormBuilder
PHP Version: Irrelevant OS: N/A
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 : 5 + 4 = ?

 
 [2004-05-24 19:57 UTC] justinpatrin
Description: ------------ When building the form, any field with type DB_DATAOBJECT_NOTNULL should have a required rule. This is easily implemented with the following 3 lines before the VALIDATION RULES loop. if($type & DB_DATAOBJECT_NOTNULL) { $form->addRule($key, 'This field is required.', 'required'); }

Comments

 [2004-05-24 23:27 UTC] justinpatrin
When making a new record, this patch can make the insert fail if the PK is NOTNULL. This altered code should fix it. if ((!in_array($key, $keys) || $hidePrimary === false) && ($type & DB_DATAOBJECT_NOTNULL)) { $form->addRule($key, 'This field is required.', 'required'); }
 [2004-05-31 15:24 UTC] mw21st
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.