DB_DataObject_FormBuilder: crossLinkExtraFields problem

From: Date: Sat, 12 Mar 2005 15:50:19 +0000
Subject: DB_DataObject_FormBuilder: crossLinkExtraFields problem
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-17996@lists.php.net to get a copy of this message
I'm having problem with the option crossLinkExtraFields. I have two tables: project (id, ... ) institution (id, ... ) cross linked by project_institution (project_id, institution_id, budget) where "budget" is a crossLinkExtraFields. I set up subclasses defining Project.php [...] var $fb_crossLinks = array ( array ( 'table' => 'project_institution ', 'fromField' => 'project_id', 'toField' => 'institution_id' ) ); Institution.php [...] var $fb_crossLinks = array ( array ( 'table' => 'project_institution ', 'fromField' => 'institution_id' 'toField' => 'project_id', ) ); Project_institution.php [...] var $fb_crossLinkExtraFields = array('budget'); The form is built correctly but, when I submit the form for "Project", I obtain an update of the project table and not of the project_institution table. One message that seems related to, is: FormBuilder: Primary key not detected - storing data not possible. Note that without the crossLinkExtraFields defined, it works properly. Is the problem related to my DB design or there is something missing in my FB config? Alberto

« previous php.pear.general (#17996) next »