Problem Inserting Unique Records on Relationship Destination

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

Problem Inserting Unique Records on Relationship Destination

Postby Cabeza » Wed Sep 26, 2012 12:59 am

There is probably a setting I am missing here, but if there is I just can't find it.

I have a simple table with two INT fields field01_id, field02_id. There is an unique index on these fields, i.e., no two records can have the same pair of these fields.

If you try to create a record with a combo that would violate the uniqueness condition (implemented as a unique index server side), Xataface correctly throws a warning and the record is not inserted.

However, if I have that table as the destination of a one-to-many relationship and try to do the same from the related records screens, still the record is NOT saved, but Xataface incorrectly reports that the record was saved.

To implement the relationship, all I did was create a relationship.ini file on the SOURCE table's directory with a single line:
[destination_table_name]
destination_table_name.joining_field = '$source_table_join_field'

Any pointers would be greatly appreciated. Thanks!
Cabeza
 
Posts: 31
Joined: Mon Sep 03, 2012 10:25 am

Re: Problem Inserting Unique Records on Relationship Destina

Postby Cabeza » Mon Oct 01, 2012 11:53 am

Steve? Anybody?
Thanks!
Cabeza
 
Posts: 31
Joined: Mon Sep 03, 2012 10:25 am

Re: Problem Inserting Unique Records on Relationship Destina

Postby shannah » Mon Oct 01, 2012 6:30 pm

This is a bug. You could provide a workaround by adding your own validation check in a beforeSave() trigger.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Problem Inserting Unique Records on Relationship Destina

Postby Cabeza » Tue Oct 02, 2012 12:57 am

Thanks Steve. I was about to go down that path.
Cheers
Cabeza
 
Posts: 31
Joined: Mon Sep 03, 2012 10:25 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 19 guests

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