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

Bug #4867 enumOptions renumbered for NULL fields
Submitted: 2005-07-20 04:17 UTC
From: evt at infoware dot com dot au Assigned: justinpatrin
Status: Closed Package: DB_DataObject_FormBuilder
PHP Version: 5.0.3 OS: Suse
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 : 32 - 15 = ?

 
 [2005-07-20 04:17 UTC] evt at infoware dot com dot au
Description: ------------ If I define my options in the enumOptions array with specific key values that I wish to store in the DB, if the DB field allows NULL then formbuilder will add the empty option and renumber my option values. This is because array_merge is used, maybe it would be better to use the + operator to merge the arrays, that way the option numbers will be preserved. formbuilder.php version: * @version $Id: FormBuilder.php,v 1.189 2005/06/17 16:32:41 justinpatrin Exp $ Reproduce code: --------------- ... if (in_array($key, $this->selectAddEmpty) || !($type & DB_DATAOBJECT_NOTNULL)) { $options = array_merge(array('' => $this->selectAddEmptyLabel), $options); } ...

Comments

 [2005-07-20 06:32 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!
 [2005-07-21 06:42 UTC] evt at infoware dot com dot au
Works perfectly, thanks.
 [2005-07-21 06:42 UTC] evt at infoware dot com dot au
Works perfectly, thanks.