Re: Bug #624 [Opn->Asn]: FormBuilder bug caused by DataObject improvements
| From: | Norbert Mocsnik | Date: | Wed, 11 Feb 2004 22:27:07 +0000 |
| Subject: | Re: Bug #624 [Opn->Asn]: FormBuilder bug caused by DataObject improvements | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-25591@lists.php.net to get a copy of this message | ||
Hello Markus,
Btw. I've tried the latest DataObject version at work and tried to regenerate the .ini file, but the output was no different than in the previous version - just strings and integers... I take it this was not the case for you, right? I've looked at the generator code and was pretty convinced that this shouldn't have been what happened...I'm sure I opened the .ini file and I saw values only like 129 and 130. Maybe you don't have any NOT NULL fields in your tables? Okay.. I made a new test now. Its output looks like: [auth_aliasok] id = 129 userid = 130 alias_csoporttag_id = 129 and it's the $Id: Generator.php,v 1.47 2004/01/18 02:54:42 alan_k Exp $. I don't want to upgrade now to the latest cvs version of Generator.php (1.60) but I looked at the cvs comments and it seems this didn't change in DataObject since then. This is not a bug, it works fine. Please check it again if you tried it with NOT NULL fields (and mysql(???)). Instead of the solution I've described (see below) please consider the other way suggested by Alan: "the correct test is switch (true) {
case ($type & DB_DATAOBJECT_INT):...
case ($type & DB_DATAOBJECT_TEXT):... They are bitwise fields.." Regards, Norbert Markus Wolff wrote:
Norbert Mocsnik wrote:I wanted to add the following comment to the bug report but I didn't succeed so here it is: ---8<---------->8--- A more forward compatible solution would be to use ifs instead of the switch structure. if ($types & DB_DATAOBJECT_INT) { [..code here..] } elseif ($types & DB_DATAOBJECT_STR) { [..code here..] } [..] This looks like unstructured but keeps FormBuilder working even when another bit(s) will be used in DataObjects field specifications. ---8<---------->8--- Regards, NorbertHi Norbert, thanks for your input, this issue is next on my list and I think I'll be able to look at it this weekend. Btw. I've tried the latest DataObject version at work and tried to regenerate the .ini file, but the output was no different than in the previous version - just strings and integers... I take it this was not the case for you, right? I've looked at the generator code and was pretty convinced that this shouldn't have been what happened... CU Markus