No tab for child table with many-to-many relationship

A place for users and developers of the Xataface to discuss and receive support.

No tab for child table with many-to-many relationship

Postby rdb » Sat Mar 07, 2009 2:15 pm

I've created a many-to-many relationship between two tables using a join table. When I view the parent table in XF, I don't get the tab for the child table displayed.

Here's the setup:

Parent table: 'people' with primary key 'id'
Child table: "research_area" with primary key 'id'
Join table: "research_area_member" with two fields:
people_id
research_area_id
which together are set as the primary key.

I have a relationships.ini file in tables/people that contains the following:

Code: Select all
[areas]
__sql__ = "SELECT *
      FROM research_area_member ram
      INNER JOIN research_area ra ON ram.research_area_id = ra.id
      WHERE ram.people_id = $id"

I also tried replacing the __sql__ statement in the relationships.ini file with:

Code: Select all
research_area.id = research_area_member.research_area_id
research_area_member.people_id = $id


but the result was the same; no tab to "areas" when listing/editing entries in the 'people' table.

I'm running mysql 5.0.45-7 under Red Hat EL 5. I've tried this with:
Xataface 1.0.7 561, and
Xataface 1.1.5r2 984

Any ideas of what might be going awry would be appreciated.

Cheers,
Richard
- -
rdb
rdb
 
Posts: 10
Joined: Wed Feb 25, 2009 10:17 am
Location: Burnaby, BC

SOLVED!

Postby rdb » Sun Mar 08, 2009 10:42 am

Doh! :oops: :oops: :oops:

Permissions problem..... never mind.
- -
rdb
rdb
 
Posts: 10
Joined: Wed Feb 25, 2009 10:17 am
Location: Burnaby, BC

Can you explain?

Postby mico » Mon Mar 30, 2009 2:18 am

rdb,

I am getting the same problem when adding a normal relation ... no tab it seems same as your problem. Can you explain how you solved it?

Thanks,
Mico
mico
 
Posts: 8
Joined: Fri Mar 27, 2009 3:13 am

Postby fongchun » Thu Apr 02, 2009 9:14 am

Mico,

It can be as simple as setting the condition attribute of the relationship to be false. If you want help, can you post a little more details of your code? (ie, the exact relationship in the relationship.ini file and other helpful information)
fongchun
 
Posts: 30
Joined: Sun Aug 03, 2008 12:23 am
Location: Vancouver, BC


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 11 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved