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

Bug #3199 Formbuilder affected by PHP Change / QuickForm issue
Submitted: 2005-01-14 09:14 UTC
From: ruempler at topconcepts dot de Assigned: justinpatrin
Status: Closed Package: DB_DataObject_FormBuilder
PHP Version: 5.0.3 OS: irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2005-01-14 09:14 UTC] ruempler at topconcepts dot de
Description: ------------ Hi, please read http://pear.php.net/bugs/bug.php?id=3189 first. This bug is triggered if I add a group for a field in the callback postGenerateForm(). The field is not in $fb_fieldsToRender, but the field name exists in the table, so setDefaults() passes data to the group. The reproduce code with a simple QF is in the bug report above. Thank you.

Comments

 [2005-01-14 17:30 UTC] justinpatrin
How are you putting a field in a group on postGenerateForm? Why? What kind of field is this? Why is it not in fieldsToRender? Is it a key? How is this value being processed? This seems like youy're mis-using the field a bit. With more info, I'm sure you can fix this without a patch to FormBuilder. That said, I'd like some feedback from Markus. Should we perhaps only set defaults for fields that we are actually processing? This would make sense to me. It's easily do-able. (Add 5 lines, remove 1)
 [2005-01-14 17:42 UTC] justinpatrin
There is a fix in CVS for this that only sets defaults for fields FormBuilder is processing. Please see if this fixes the issue for you. I also want a response to my previous comment, though.
 [2005-01-14 18:05 UTC] ruempler at topconcepts dot de
Thx, Justin, the fix works for me. I have file upload fields and they are getting a specific group with the file element, a link for preview (only if a file is already uploaded) and a checkbox for deleting the existing file. In the table I store the file extension (group element name and field name are the same), because i then can link to the image with table_name/field_name/$id.$ext in the file-system. In postGenerateForm i add the group by my-self with insertElementBefore() and the $fb_fieldLabels. The upload handling is done in preProcessForm and postProcessForm. Hope that helped you to understand the problem. Maybe there is a better solution for that? But before PHP 5.0.3 it worked perfectly ;-)
 [2005-01-17 18:47 UTC] justinpatrin
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.