Commit a99b82c5 authored by eileen's avatar eileen

Fix mishandling / loss of check_permission flag

parent 1876e376
......@@ -125,6 +125,7 @@ class CRM_Dedupe_Finder {
if (!$params) {
return array();
}
$checkPermission = CRM_Utils_Array::value('check_permission', $params, TRUE);
// This may no longer be required - see https://github.com/civicrm/civicrm-core/pull/13176
$params = array_filter($params);
......@@ -146,7 +147,6 @@ class CRM_Dedupe_Finder {
CRM_Core_Error::fatal("$used rule for $ctype does not exist");
}
}
$params['check_permission'] = CRM_Utils_Array::value('check_permission', $params, TRUE);
if (isset($params['civicrm_phone']['phone_numeric'])) {
$orig = $params['civicrm_phone']['phone_numeric'];
......@@ -155,7 +155,7 @@ class CRM_Dedupe_Finder {
$rgBao->params = $params;
$rgBao->fillTable();
$dao = new CRM_Core_DAO();
$dao->query($rgBao->thresholdQuery($params['check_permission']));
$dao->query($rgBao->thresholdQuery($checkPermission));
$dupes = array();
while ($dao->fetch()) {
if (isset($dao->id) && $dao->id) {
......
......@@ -692,9 +692,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase {
],
'check_permissions' => 0,
]);
// Actually this should be 2 but there is a line of array_filter in dupesByParams that causes
// check_permissions to be dropped at that point. I am working aginst rc now - that should possibly be removed against master.
$this->assertEquals(1, $dupes['count']);
$this->assertEquals(2, $dupes['count']);
CRM_Core_Config::singleton()->userPermissionClass->permissions = ['administer CiviCRM'];
$dupes = $this->callAPISuccess('Contact', 'duplicatecheck', [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment