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

Bug #1931 Associative array options call not working in create
Submitted: 2004-07-21 00:33 UTC
From: marcelo at beteltecnologia dot com dot br Assigned: justinpatrin
Status: Closed Package: DB_DataObject_FormBuilder
PHP Version: 4.3.7 OS: Windows XP
Roadmaps: (Not assigned)    
Subscription  


 [2004-07-21 00:33 UTC] marcelo at beteltecnologia dot com dot br
Description: ------------ calling create method with associative array options didn“t work for change of form_header_text. I managed to find the problem: Since default form_header_text is set to null, isset equals false, the code in the constructor is preventing the setting, especifically the if (isset($this->$key)) in the loop for $options. Below I point the broken code at the class constructor. Reproduce code: --------------- function DB_DataObject_FormBuilder(&$do, $options=false) { global $_DB_DATAOBJECT_FORMBUILDER; // Set default callbacks first! $this->_dateToDatabaseCallback = array($this,'_array2date'); $this->_dateFromDatabaseCallback = array($this,'_date2array'); // Read in config if (is_array($options)) { reset($options); while (list($key, $value) = each($options)) { if (isset($this->$key)) { //<=PROBLEM FOR $this->form_header_text! $this->$key = $value; } } } ... Expected result: ---------------- I only ask: Why is this condition being tested since I am setting the variable and should'nt matter if it is or not already set? Thanks and keep going because your class is very nice!

Comments

 [2004-07-21 03:34 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!