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 #3845

linkNewValue and virtual fields prefixing

Details

Submitted2005-03-16 15:46 UTC
Fromgiorgiogorla at libero dot it
Assignedjustinpatrin
StatusBogus
PackageDB_DataObject_FormBuilder
PHP Version4.3.8
OSlinux, fedora core 1
Roadmaps(Not assigned)

Comments

[2005-03-16 15:46 UTC] giorgiogorla at libero dot it

Description:
------------
If we have set virtual fields with the same names in DO classes of two linked tables, the html code will have duplicated form's tags with the same names (the second ones not prefixed at all).

[2005-03-17 12:11 UTC] giorgiogorla at libero dot it

in do.links.ini:

[table1]
table2Id = table2:id

In Table1 Class AND in Table2 Class

function table() {
return array_merge(parent::table(), array('virtualfield' => DB_DATAOBJECT_STR)
}

function preGenerateForm () { // {{{
$this->fb_preDefElements['virtualfield'] =& HTML_QuickForm::createElement('hidden', 'virtualfield');
}

In myscript.php I set

$doTable1->virtualfield = 'anyvalue';

With $doTable1->fb_linkNewValue set to TRUE, I have:

<form action="myscript.php" method="post" name="dataobjects_table1" id="dataobjects_table1">
<div>
<input name="virtualfield" type="hidden" value="anyvalue" />
....
<div id="id_table2" class="hidden">
<div>
<input name="virtualfield" type="hidden" value="" />
...

The second tag is unprefixed with id_table2__ and overwrites the first one.

[2005-03-21 12:17 UTC] giorgiogorla at libero dot it

Disabling linkNewValue, this error doesn't appear.
But Y, I think you could be right.

Note. Only virtual fields aren't prefixed, db fields are.

[2005-03-22 10:07 UTC] giorgiogorla at libero dot it

I've tried. Virtual Fields don't change.

[2005-04-01 09:34 UTC] giorgiogorla at libero dot it

It doesn't function too :((

[2005-04-07 11:00 UTC] giorgiogorla at libero dot it

I made this for all fields that I put in preGeneratedForm ().
I've to add that db fields that I put in preGeneratedForm () aren't pre/post-fixed.