PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB_DataObject_FormBuilder » Bug #7604

extraFields in crossLinks does not work

Details

Submitted2006-05-11 11:41 UTC
Frommarek dot zebrowski at gmail dot com
Assignedjustinpatrin
StatusNo Feedback
PackageDB_DataObject_FormBuilder
PHP Version4.4.0
OSLinux
Roadmaps(Not assigned)

Comments

[2006-05-11 11:41 UTC] marek dot zebrowski at gmail dot com

Description:
------------
I have 3 tables:
A,B and C
C is a crosslink with one extra field
C(
fkA int
fkB int
extra text
)

in class definition for A I have
var $fb_crossLinks = array(array('table' => 'C','fromField'=>"fkA","toField"=>"fkB"));
in class definition fo C I have
var $fb_crossLinkExtraFields=array("kwota");

Form form A is shown OK (it has both checkboxes and input texts),
but processForm does not save or update table C

[2006-05-11 12:11 UTC] marek dot zebrowski at gmail dot com

quick fix is to add a line marked by ++ to before line 2848
++$this->_extraFieldsFb[$crossLinkPrefix.$crossLinkPostfix]->forceQueryType(DB_DATAOBJECT_FORMBUILDER_QUERY_FORCEINSERT);
$ret=$this->_extraFieldsFb[$crossLinkPrefix.$crossLinkPostfix]->processForm($insertValues);

[2006-05-15 06:03 UTC] marek dot zebrowski at gmail dot com

My PK are fine. I use postgres, maybe that has something
to do.
Below are real statements

CREATE TABLE w (
id SERIAL PRIMARY KEY,
other TEXT
);

CREATE TABLE p (
id SERIAL PRIMARY KEY,
other TEXT
);

CREATE TABLE wp (
w INT4 NOT NULL REFERENCES W(id),
p INT4 NOT NULL REFERENCES p(id),
k numeric(14,2) NOT NULL DEFAULT 0,
PRIMARY KEY(w,p)
);

[wp]
w=w:id
p=p:id

and in class db_wp
var $fb_crossLinsExtraFields=array("k")