From: monishdeb Date: Fri, 31 Jul 2015 12:28:50 +0000 (+0530) Subject: test build failure fix X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=db135a44bd00c9c6045bba1d80eed2257b8dd1ba;p=civicrm-core.git test build failure fix --- diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 5fbb6f6e68..5b9fbc2e9e 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -1335,7 +1335,7 @@ class CRM_Contact_BAO_Query { // 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) ) { @@ -1841,26 +1841,7 @@ class CRM_Contact_BAO_Query { } // 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]); diff --git a/CRM/Contact/Form/Search/Basic.php b/CRM/Contact/Form/Search/Basic.php index 9387d6b08b..86148ec493 100644 --- a/CRM/Contact/Form/Search/Basic.php +++ b/CRM/Contact/Form/Search/Basic.php @@ -182,7 +182,7 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { } 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 @@ -229,20 +229,6 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { $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; } diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 79f7f12b56..ffb02e8458 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -2147,7 +2147,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac 'payment_processor' ); if ($paymentProcessorID) { - //$intentionalEnotice = $CRM16923AnUnreliableMethodHasBeenUserToDeterminePaymentProcessorFromContributionPage; + $intentionalEnotice = $CRM16923AnUnreliableMethodHasBeenUserToDeterminePaymentProcessorFromContributionPage; } } diff --git a/api/v3/Contact.php b/api/v3/Contact.php index 6eea28270e..4ae0ed576a 100644 --- a/api/v3/Contact.php +++ b/api/v3/Contact.php @@ -337,8 +337,6 @@ function _civicrm_api3_contact_get_supportanomalies(&$params, &$options) { $groups = explode(',', $params['filter.group_id']); } unset($params['filter.group_id']); - $groups = array_flip($groups); - $groups[key($groups)] = 1; $options['input_params']['group'] = $groups; } } diff --git a/api/v3/utils.php b/api/v3/utils.php index 479afac1b6..d2b8495f83 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -900,17 +900,6 @@ function _civicrm_api3_get_using_query_object($entity, $params, $additional_opti } $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;