Page 1 of 1

Problem Inserting Unique Records on Relationship Destination

PostPosted: Wed Sep 26, 2012 12:59 am
by Cabeza
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!

Re: Problem Inserting Unique Records on Relationship Destina

PostPosted: Mon Oct 01, 2012 11:53 am
by Cabeza
Steve? Anybody?
Thanks!

Re: Problem Inserting Unique Records on Relationship Destina

PostPosted: Mon Oct 01, 2012 6:30 pm
by shannah
This is a bug. You could provide a workaround by adding your own validation check in a beforeSave() trigger.

-Steve

Re: Problem Inserting Unique Records on Relationship Destina

PostPosted: Tue Oct 02, 2012 12:57 am
by Cabeza
Thanks Steve. I was about to go down that path.
Cheers