Skip to content
Snippets Groups Projects
Commit f6df6998 authored by Prasad's avatar Prasad
Browse files

Merge branch 'fix_additional_users_fields' into 'master'

fix #221 use assigned_user_id in preference to other users UItype 10 fields

minor improvement that has an effect when there are multiple fields on an entity linking to Users, this helps it pick the right owner field.

See merge request !69
parents 03615190 bfaf4863
No related branches found
No related tags found
No related merge requests found
......@@ -550,7 +550,12 @@ class QueryGenerator {
}
$ownerFields = $this->meta->getOwnerFields();
if (count($ownerFields) > 0) {
$ownerField = $ownerFields[0];
//there are more than one field pointing to the users table, the real one is the one called assigned_user_id if there is one, otherwise pick the first
if(in_array("assigned_user_id",$ownerFields)){
$ownerField="assigned_user_id";
}else{
$ownerField = $ownerFields[0];
}
}
$baseTable = $this->meta->getEntityBaseTable();
$sql = " FROM $baseTable ";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment