Ok from what I can work out the ElasticsearchType_artefact::getRecordById() only checks for access attached to a view.
And group files are not attached to a view so can't be seen.
One can see files in Content -> Files because the files have an owner id set but not in Group -> [groupname] -> Files because they don't have an owner.
So I think we need to check if artefact has no owner but has a group id and then get who is allowed to view artefact and add that to its access array.
Ok from what I can work out the ElasticsearchTy pe_artefact: :getRecordById( ) only checks for access attached to a view.
And group files are not attached to a view so can't be seen.
One can see files in Content -> Files because the files have an owner id set but not in Group -> [groupname] -> Files because they don't have an owner.
So I think we need to check if artefact has no owner but has a group id and then get who is allowed to view artefact and add that to its access array.
Does that sound like what the problem is?