Home » Database » DB_DataObject_FormBuilder » Bug #3082
_multiArrayToSingleArray()/prefix/postfix causes grouped elements to be ignored
Details
| Submitted | 2005-01-03 14:47 UTC |
|---|---|
| From | ate2 at cornell dot edu |
| Assigned | justinpatrin |
| Status | Closed |
| Package | DB_DataObject_FormBuilder |
| PHP Version | Irrelevant |
| OS | Irrelevant (but Debian sarge) |
| Roadmaps | (Not assigned) |
Comments
[2005-01-03 14:47 UTC] ate2 at cornell dot edu
Description:
------------
Current implementation of postfix/prefix calls
_multiArrayToSingleArray() to "flatten" postfices and
prefices. Any grouped elements are then excluded by the
processForm because the name with trailing array
information is not in $editableFields. In particular,
FB will not process date fields.
I re-wrote _getMyValues() to correctly handle postfix/
prefix stripping and preserve the arrays of grouped
element values and have included it in the reproduce
code.
The method I wrote also filters out any fields which do
not have the specified pre/post fixes and it passes the
values array by reference to avoid unnecessary copying
when values remain unchanged.
Reproduce code:
---------------
My modifications are at:
http://environment.cornell.edu/source/DB.DataObject.FormBuilder.phps
[2005-01-04 17:43 UTC] ate2 at cornell dot edu
If someone chooses to encapsulate their form in an
array, won't they have the same problems that occur when
flattening? eg: a date element would generate:
someArr[blah][someDate[M]],
someArr[blah][someDate[d]]....
[2005-01-05 20:26 UTC] ate2 at cornell dot edu
Thanks. CVS version seems to work fine. I would still
prefer having _getMyValues() return only
appropriately prefixed and suffixed fields and having it
use references at least internally to avoid some
unnecessary copying. That would be especially useful
when debugging (so that all the other fields in the form
don't generate "not user editable" messages when
processed).