PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_DataObject_FormBuilder » Bug #1960

can't use UseForm two combine two forms with similar field names

Details

Request #1960can't use UseForm two combine two forms with similar field names
Submitted2004-07-22 21:42 UTC
Fromjsnell at networkninja dot com
Assignedjustinpatrin
StatusClosed
PackageDB_DataObject_FormBuilder
PHP Version4.3.4
OSLinux
Roadmaps(Not assigned)

Comments

[2004-07-22 21:42 UTC] jsnell at networkninja dot com

Description:
------------
Following some of the examples on the powerpoint presentation, I have been trying to use multiple data objects in the same form. One issues I've run into is that FormBuilder uses the field names as the database fields. While this isn't such a bad thing, it makes it problematic to auto build two forms from the same table. It would be very useful to me and possibly others to be able to work with multiple data objects of the same type on the same form.

Reproduce code:
---------------
http://www.e-normous.com/nerd/formbuilder/edit_1.phps

Expected result:
----------------
A form which will save to all objects involved

A patch to produce the expected results, based on the 0.9 source (my CVS checkout didn't appear to have any changes made regarding this):
http://www.e-normous.com/nerd/formbuilder/proposed_0.9fix.patch
and the source changes:
http://www.e-normous.com/nerd/formbuilder/edit_2.phps

The proposed patch probably isn't the cleanest way to do this, it requires some other changes. Each form has to be processed separately, and it requires altering postGenerateForm callbacks to deal with the prefix. Each form also has to be assigned a prefix manually with this setup. Then, each formbuilder object has to be validated and processed separately. It probably wouldn't be a bad idea to default it to the class name.

Actual result:
--------------
Names are reused, can't use two objects with the same field names, or in my case, two of the same object

[2004-07-23 15:59 UTC] jsnell at networkninja dot com

I will prepare a patch for the CVS version for you guys to take a look at. I wanted to make sure it had some chance of being considered before all of the extra work.