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

Bug #624 FormBuilder bug caused by DataObject improvements
Submitted: 2004-01-26 00:36 UTC
From: pear-dev at mocsnik dot hu Assigned: mw21st
Status: Closed Package: DB_DataObject_FormBuilder
PHP Version: Irrelevant OS: irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2004-01-26 00:36 UTC] pear-dev at mocsnik dot hu
Description: ------------ Some version of DB_DataObject introduced define('DB_DATAOBJECT_NOTNULL', 128); // not null col. besides the already existing types: define('DB_DATAOBJECT_INT', 1); // does not require '' define('DB_DATAOBJECT_STR', 2); // requires '' etc (DB_DataObject code) This results in unsure field type auto-detection in FormBuilders generateForm() method since it actually looks like: switch ($type) { case DB_DATAOBJECT_INT: (code here) [..] case DB_DATAOBJECT_TXT: (code here) [..] } Possible solution: a) switch ($type) { case DB_DATAOBJECT_INT: case DB_DATAOBJECT_INT+DB_DATAOBJECT_NOTNULL: (code here) [...] case DB_DATAOBJECT_TXT: case DB_DATAOBJECT_TXT+DB_DATAOBJECT_NOTNULL: (code here) [..] } Reproduce code: --------------- Any code using FormBuilder with NOT NULL fields (mysql specific??) Expected result: ---------------- Correct detection of field types. Actual result: -------------- Wrong type of input elements are generated because of not up-to-date field type auto-detection.

Comments

 [2004-02-11 09:10 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!
 [2004-02-28 03:26 UTC] pear-dev at mocsnik dot hu
Please consider using switch ($type & 127) as proposed by bubik at acvyskov dot cz in bug #919 (referring to the same bug) http://pear.php.net/bugs/bug.php?id=919 Regards, Norbert Mocsnik
 [2004-03-03 01:41 UTC] pear-dev at mocsnik dot hu
By introducing DB_DATAOBJECT_MYSQLTIMESTAMP (value 256) in DB_DataObject this won't work anymore. Please use Alan's version: switch (true) { case ($type & DB_DATAOBJECT_INT): ...
 [2004-05-15 22:21 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!