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);
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'];
$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) {
],
'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', [