Re: Re: DB_DataObject_FormBuilder: crossLinkExtraFields problem
| From: | Justin Patrin | Date: | Sat, 12 Mar 2005 21:24:46 +0000 |
| Subject: | Re: Re: DB_DataObject_FormBuilder: crossLinkExtraFields problem | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-18006@lists.php.net to get a copy of this message | ||
On Sat, 12 Mar 2005 19:30:54 +0100, Dot Deb <dotdeb@gmail.com> wrote:
> Solved adding a primary key in the x-ref table.
> Sorry for those who spent their time on this subject.
Yep, that's it. ;-) Glad you fixed it. And I'm glad the debug messages
helped you, that's what they're there for.
>
> Alberto
>
>
> On Sat, 12 Mar 2005 16:50:19 +0100, Dot Deb <dotdeb@gmail.com> wrote:
> > 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
> >
--
Justin Patrin