#4424 - Dashlet - Relationship additional assigned users - Query failed, id is ambiguous
Hi there,
We are using SuiteCRM 7.11.10 and the latest SecuritySuite install (3.1.21).
Since we've installed the module, no records are visible in the "My calls" dashlet. The following error is visible in the log file:
Query Failed: SELECT DISTINCT calls.id ,calls_cstm.kans_score_c, calls.parent_id , calls_cstm.campaign_id_c , calls.assigned_user_id , calls.name , calls.parent_type , calls.date_start , jt0.name campagne_c , jt1.user_name assigned_user_name , jt1.created_by assigned_user_name_owner , 'Users' assigned_user_name_mod, calls.created_by , calls.date_entered FROM calls LEFT JOIN calls_cstm ON calls.id = calls_cstm.id_c LEFT JOIN campaigns jt0 ON calls_cstm.campaign_id_c = jt0.id AND jt0.deleted=0 LEFT JOIN users jt1 ON calls.assigned_user_id=jt1.id AND jt1.deleted=0
AND jt1.deleted=0 where ((calls.status IN ('Planned')
) AND (calls.date_start>='2020-09-20 22:00:00' AND calls.date_start<='2020-09-21 21:59:59'
) AND ( (calls.assigned_user_id IN ('301a62e7-0c96-035f-cb71-5f0856d23b5e')
OR id in (select record_id from securitygroups_additionalusers where deleted = 0 and module = 'Calls' and user_id in ( '301a62e7-0c96-035f-cb71-5f0856d23b5e' )) ) )) AND calls.deleted=0 ORDER BY calls.date_start ASC LIMIT 0,11: MySQL error 1052: Column 'id' in IN/ALL/ANY subquery is ambiguous
It seems that the "... OR id in (select record_id ..." part of the query is wrong, it should be "... OR calls.id in (select record_id ...", because there is another link to the campaigns module that is also providing an 'id' field, which makes the field ambiguous when calling without the table prefix.
I tried to find where this is located so I can fix it myself, but didn't manage to get there.
Thanks a lot!
4 years ago
4 years ago
4 years ago
4 years ago