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  


 [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.