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)    

 [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) {


 [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 In case this was a 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.