// make sure there is only one element
// this is used when we are running under smog and need to know
// how the contact was added (CRM-1203)
- $groups = CRM_Utils_Array::value($this->_paramLookup['group'][0][1], $this->_paramLookup['group'][0][2], $this->_paramLookup['group'][0][2]);
+ $groups = (array) CRM_Utils_Array::value($this->_paramLookup['group'][0][1], $this->_paramLookup['group'][0][2], $this->_paramLookup['group'][0][2]);
if ((count($this->_paramLookup['group']) == 1) &&
(count($groups) == 1)
) {
}
// check for both id and contact_id
if ($this->_params[$id][0] == 'id' || $this->_params[$id][0] == 'contact_id') {
- if (
- $this->_params[$id][1] == 'IS NULL' ||
- $this->_params[$id][1] == 'IS NOT NULL'
- ) {
- $this->_where[0][] = "contact_a.id {$this->_params[$id][1]}";
- }
- elseif (is_array($this->_params[$id][2])) {
- $idList = implode("','", $this->_params[$id][2]);
- //why on earth do they put ' in the middle & not on the outside? We have to assume it's
- //to support 'something' so lets add them conditionally to support the api (which is a tested flow
- // so if you are looking to alter this check api test results
- if (strpos(trim($idList), "'") > 0) {
- $idList = "'" . $idList . "'";
- }
-
- $this->_where[0][] = "contact_a.id IN ({$idList})";
- }
- else {
- $this->_where[0][] = self::buildClause("contact_a.id", "{$this->_params[$id][1]}", "{$this->_params[$id][2]}");
- }
+ $this->_where[0][] = self::buildClause("contact_a.id", $this->_params[$id][1], $this->_params[$id][2]);
}
else {
$this->whereClauseSingle($this->_params[$id]);
}
if (isset($this->_groupID) && empty($this->_formValues['group'])) {
- $this->_formValues['group'][$this->_groupID] = 1;
+ $this->_formValues['group'] = $this->_groupID;
}
elseif (isset($this->_ssID) && empty($_POST)) {
// if we are editing / running a saved search and the form has not been posted
$this->_formValues['contact_type'][$contactType] = 1;
}
- $config = CRM_Core_Config::singleton();
-
- $group = CRM_Utils_Array::value('group', $this->_formValues);
- if ($group && !is_array($group)) {
- unset($this->_formValues['group']);
- $this->_formValues['group'][$group] = 1;
- }
-
- $tag = CRM_Utils_Array::value('tag', $this->_formValues);
- if ($tag && !is_array($tag)) {
- unset($this->_formValues['tag']);
- $this->_formValues['tag'][$tag] = 1;
- }
-
return NULL;
}
'payment_processor'
);
if ($paymentProcessorID) {
- //$intentionalEnotice = $CRM16923AnUnreliableMethodHasBeenUserToDeterminePaymentProcessorFromContributionPage;
+ $intentionalEnotice = $CRM16923AnUnreliableMethodHasBeenUserToDeterminePaymentProcessorFromContributionPage;
}
}
$groups = explode(',', $params['filter.group_id']);
}
unset($params['filter.group_id']);
- $groups = array_flip($groups);
- $groups[key($groups)] = 1;
$options['input_params']['group'] = $groups;
}
}
}
$newParams = CRM_Contact_BAO_Query::convertFormValues($inputParams);
- foreach ($newParams as &$newParam) {
- if ($newParam[1] == '=' && is_array($newParam[2])) {
- // we may be looking at an attempt to use the 'IN' style syntax
- // @todo at time of writing only 'IN' & 'NOT IN' are supported for the array style syntax
- $sqlFilter = CRM_Core_DAO::createSqlFilter($newParam[0], $params[$newParam[0]], 'String', NULL, TRUE);
- if ($sqlFilter) {
- $newParam[1] = key($newParam[2]);
- $newParam[2] = $sqlFilter;
- }
- }
- }
$skipPermissions = !empty($params['check_permissions']) ? 0 : 1;