From 355222797f93351f35e146bca57dcaa7fbc787e1 Mon Sep 17 00:00:00 2001 From: JKingsnorth Date: Wed, 20 Jul 2016 13:33:37 +0100 Subject: [PATCH] CRM-19108: Fix incorrect case on CRM_Utils_array --- CRM/Activity/BAO/Activity.php | 2 +- CRM/Case/Form/Activity.php | 2 +- CRM/Contribute/Form/Contribution/Main.php | 6 +++--- CRM/Contribute/Form/ContributionBase.php | 4 ++-- CRM/Dedupe/Merger.php | 6 +++--- CRM/Report/Form/Contact/Relationship.php | 2 +- CRM/Utils/REST.php | 14 +++++++------- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index e323eb1bea..3be24e0457 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -479,7 +479,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity { } if (!empty($params['target_contact_id'])) { - if (is_array($params['target_contact_id']) && !CRM_Utils_array::crmIsEmptyArray($params['target_contact_id'])) { + if (is_array($params['target_contact_id']) && !CRM_Utils_Array::crmIsEmptyArray($params['target_contact_id'])) { $msgs[] = "target=" . implode(',', $params['target_contact_id']); // take only first target // will be used for recently viewed display diff --git a/CRM/Case/Form/Activity.php b/CRM/Case/Form/Activity.php index bac8f22305..ee9b585dd0 100644 --- a/CRM/Case/Form/Activity.php +++ b/CRM/Case/Form/Activity.php @@ -597,7 +597,7 @@ class CRM_Case_Form_Activity extends CRM_Activity_Form_Activity { foreach ($vvalue as $vkey => $vval) { foreach ($selectedContacts as $dnt => $val) { - if (array_key_exists($val, $params) && !CRM_Utils_array::crmIsEmptyArray($params[$val])) { + if (array_key_exists($val, $params) && !CRM_Utils_Array::crmIsEmptyArray($params[$val])) { if ($val == 'contact_check') { $mailStatus = ts("A copy of the activity has also been sent to selected contacts(s)."); } diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 07f60f40c5..9b9f4ad476 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -880,10 +880,10 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu if (CRM_Utils_Array::value('pledge_installments', $fields) == NULL) { $errors['pledge_installments'] = ts('Pledge Installments is required field.'); } - elseif (CRM_Utils_array::value('pledge_installments', $fields) == 1) { + elseif (CRM_Utils_Array::value('pledge_installments', $fields) == 1) { $errors['pledge_installments'] = ts('Pledges consist of multiple scheduled payments. Select one-time contribution if you want to make your gift in a single payment.'); } - elseif (CRM_Utils_array::value('pledge_installments', $fields) == 0) { + elseif (CRM_Utils_Array::value('pledge_installments', $fields) == 0) { $errors['pledge_installments'] = ts('Pledge Installments field must be > 1.'); } } @@ -896,7 +896,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu if (CRM_Utils_Array::value('pledge_frequency_interval', $fields) == NULL) { $errors['pledge_frequency_interval'] = ts('Pledge Frequency Interval. is required field.'); } - elseif (CRM_Utils_array::value('pledge_frequency_interval', $fields) == 0) { + elseif (CRM_Utils_Array::value('pledge_frequency_interval', $fields) == 0) { $errors['pledge_frequency_interval'] = ts('Pledge frequency interval field must be > 0'); } } diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 1e99b778f4..697eb6c996 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -573,11 +573,11 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { $this->assign('bank_account_number', $this->_params['bank_account_number']); } else { - $date = CRM_Utils_Date::format(CRM_Utils_array::value('credit_card_exp_date', $this->_params)); + $date = CRM_Utils_Date::format(CRM_Utils_Array::value('credit_card_exp_date', $this->_params)); $date = CRM_Utils_Date::mysqlToIso($date); $this->assign('credit_card_exp_date', $date); $this->assign('credit_card_number', - CRM_Utils_System::mungeCreditCard(CRM_Utils_array::value('credit_card_number', $this->_params)) + CRM_Utils_System::mungeCreditCard(CRM_Utils_Array::value('credit_card_number', $this->_params)) ); } } diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index 715f98318c..c12653c30c 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -1729,8 +1729,8 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m } // CRM-15681 merge sub_types - if ($other_sub_types = CRM_Utils_array::value('contact_sub_type', $migrationInfo['other_details'])) { - if ($main_sub_types = CRM_Utils_array::value('contact_sub_type', $migrationInfo['main_details'])) { + if ($other_sub_types = CRM_Utils_Array::value('contact_sub_type', $migrationInfo['other_details'])) { + if ($main_sub_types = CRM_Utils_Array::value('contact_sub_type', $migrationInfo['main_details'])) { $submitted['contact_sub_type'] = array_unique(array_merge($main_sub_types, $other_sub_types)); } else { @@ -1959,7 +1959,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * $specialValues */ public static function getSpecialValues($contact) { - $preferred_communication_method = CRM_Utils_array::value('preferred_communication_method', $contact); + $preferred_communication_method = CRM_Utils_Array::value('preferred_communication_method', $contact); $value = empty($preferred_communication_method) ? array() : $preferred_communication_method; $specialValues = array( 'preferred_communication_method' => $value, diff --git a/CRM/Report/Form/Contact/Relationship.php b/CRM/Report/Form/Contact/Relationship.php index 0b44dffd90..7d84f079a6 100644 --- a/CRM/Report/Form/Contact/Relationship.php +++ b/CRM/Report/Form/Contact/Relationship.php @@ -522,7 +522,7 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { //for displaying relationship type filter if ($value['title'] == 'Relationship') { $relTypes = CRM_Core_PseudoConstant::relationshipType(); - $op = CRM_Utils_array::value('relationship_type_id_op', $this->_params) == 'in' ? + $op = CRM_Utils_Array::value('relationship_type_id_op', $this->_params) == 'in' ? ts('Is one of') . ' ' : ts('Is not one of') . ' '; $relationshipTypes = array(); foreach ($this->_params['relationship_type_id_value'] as $relationship) { diff --git a/CRM/Utils/REST.php b/CRM/Utils/REST.php index 6cdb5fe1e1..35e4e9b123 100644 --- a/CRM/Utils/REST.php +++ b/CRM/Utils/REST.php @@ -282,13 +282,13 @@ class CRM_Utils_REST { $requestParams = CRM_Utils_Request::exportValues(); // Get the function name being called from the q parameter in the query string - $q = CRM_Utils_array::value('q', $requestParams); + $q = CRM_Utils_Array::value('q', $requestParams); // or for the rest interface, from fnName - $r = CRM_Utils_array::value('fnName', $requestParams); + $r = CRM_Utils_Array::value('fnName', $requestParams); if (!empty($r)) { $q = $r; } - $entity = CRM_Utils_array::value('entity', $requestParams); + $entity = CRM_Utils_Array::value('entity', $requestParams); if (empty($entity) && !empty($q)) { $args = explode('/', $q); // If the function isn't in the civicrm namespace, reject the request. @@ -311,8 +311,8 @@ class CRM_Utils_REST { // or the api format (entity+action) $args = array(); $args[0] = 'civicrm'; - $args[1] = CRM_Utils_array::value('entity', $requestParams); - $args[2] = CRM_Utils_array::value('action', $requestParams); + $args[1] = CRM_Utils_Array::value('entity', $requestParams); + $args[2] = CRM_Utils_Array::value('action', $requestParams); } // Everyone should be required to provide the server key, so the whole @@ -320,7 +320,7 @@ class CRM_Utils_REST { // first check for civicrm site key if (!CRM_Utils_System::authenticateKey(FALSE)) { $docLink = CRM_Utils_System::docURL2("Managing Scheduled Jobs", TRUE, NULL, NULL, NULL, "wiki"); - $key = CRM_Utils_array::value('key', $requestParams); + $key = CRM_Utils_Array::value('key', $requestParams); if (empty($key)) { return self::error("FATAL: mandatory param 'key' missing. More info at: " . $docLink); } @@ -669,7 +669,7 @@ class CRM_Utils_REST { */ public function loadCMSBootstrap() { $requestParams = CRM_Utils_Request::exportValues(); - $q = CRM_Utils_array::value('q', $requestParams); + $q = CRM_Utils_Array::value('q', $requestParams); $args = explode('/', $q); // Proceed with bootstrap for "?entity=X&action=Y" -- 2.25.1