Form with 2 N-N relation fields configured to same assoc table

Hi there - i hope that its not again one of this questions :slight_smile: wchich are not responded at all :slight_smile:

Bussines logic needed

We got configuration for role - activities in workflow engine - that associacion is hold by simple table with id, activity_id, role_id

before that we got
roles - table where all roles are described by role_id and role_name

symilar with activities - we got activity table where we got activity_id and activity_name

Activity table structure hold additionall info about activity - that activiti is interactive or not (if not interactive its something like process state from wchich users starts interactive activities (concept of galaxia workflow - if anyone want to explore it for himself)

Ok scriptcase form now
we got 1 form for define role - simple form role id, role name, role description 3 fields
in this form i like to add N-N relation based on activity table who grab role id + activity id and save it to activity + role association table

if i will make one N-N relation field to hold there all activities - something like that
select id, activity_name from eat_process_activities where process_id = β€˜{process_id}’ order by activity_name

then all perfectly working - soo i can see list of activity names and check activities i like (in my case i am using checkboxes) and i got all updates in association table in db

PROBLEM
when i try separate activity to 2 groups - noninteractive (states) and interactive
with adding to my sql where clause

and activity_interactive = β€˜0’

soo it give sql for
non interactive N-N relation field
[INDENT]select id, activity_name from eat_process_activities
where process_id = β€˜{process_id}’
and activity_interactive = β€˜0’
order by activity_name
[/INDENT]
And for interactive field
[INDENT]select id, activity_name from eat_process_activities
where process_id = β€˜{process_id}’
and activity_interactive = β€˜1’
order by activity_name
[/INDENT]

Then i get perfect prepared form - exactly as i need i got 2 N-N fields filed up with right activities in
[B][SIZE=3]BUT when i press update - then all checkers pressed on first N-N fields are dischecked

second N-N field works perfectly as it should

When i change order of fileds - always second field in order working ok - and first one setting his checkers to unset[/SIZE][/B]

Its a bug - or normal behaviour ?
Is anyone was fighting with that before ?
Help plz.

Ps. below 2 screenshots of that app just to better imagination what is going on here

nn_bug1.jpg

nn_bug2.jpg

I’m having the same issue. When running the form application with debug mode ON, I see there are two SQL select queries which are exactly the same; only the second one actually populates the N-N field - like it’s overriding the first.

info@eat.pl, did you ever figure this one out?

I had to split the associated table into two tables storing each type. Only way I could get it to work.