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

Bug #1459 preDefElements can only be used once per DO
Submitted: 2004-05-21 00:36 UTC
From: justinpatrin Assigned: mw21st
Status: Closed Package: DB_DataObject_FormBuilder
PHP Version: Irrelevant OS: N/A
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 : 15 - 13 = ?

 
 [2004-05-21 00:36 UTC] justinpatrin
Description: ------------ Since _reorderElements uses each(), it moves the internal pointer of preDefOrder while it's running *and leaves it at the end of the array*. This could affect people who, for instance, use a while($do->fetch()) and display lots of forms. This could be fixed with a reset() at the end or beginning of the while loop, but IMHO it's just better to do a foreach. Just replace: while(list($index, $elem) = each($this->_do->preDefOrder)) { with: foreach($this->_do->preDefOrder as $index => $elem) { or even (since $index isn't used): foreach($this->_do->preDefOrder as $elem) {

Comments

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