Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7
-
Fix Version/s: 4.7
-
Component/s: Core CiviCRM
-
Labels:
-
Documentation Required?:None
-
Funding Source:Core Team Funds
Description
using 4.7 beta 6
to reproduce, create a profile to be used for searching and limit it to a group. run a search and attempt to view a contact in the result list. you'll be given the message:
"Permission Denied You do not have permission to view this contact record. Contact the site administrator if you need assistance."
the breakdown happens in CRM_Contact_BAO_Query around line 4260 in the apiQuery where new CRM_Contact_BAO_Query is called. the params passed are correct. the group param comes as:
[0] => Array ( [0] => group [1] => IN [2] => Array ( [6] => 1 ) [3] => 0 [4] => 0 )
but the query built from it always uses group ID 1. I suspect that where the group ID is the array key in the params above (6), the query is getting built from the key value.
if you try to reproduce and don't get an error, make sure the contact you're looking at does not exist in group 1.