diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index 9193a4d7ade7..d4452063e1d8 100644 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -671,10 +671,7 @@ private function processContribution(array &$params): bool { [$products, $options] = CRM_Contribute_BAO_Premium::getPremiumProductInfo(); $value['hidden_Premium'] = 1; - $value['product_option'] = CRM_Utils_Array::value( - $value['product_name'][1], - $options[$value['product_name'][0]] - ); + $value['product_option'] = $options[$value['product_name'][0]][$value['product_name'][1]] ?? NULL; $premiumParams = [ 'product_id' => $value['product_name'][0], diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 5ae6ef0a74cf..4ebc1f4e9295 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -1224,10 +1224,7 @@ protected function processCreditCard($submittedValues, $lineItem, $contactID) { // @todo - stop setting amount level in this function - use $this->order->getAmountLevel() $this->_params['amount_level'] = 0; $this->_params['description'] = ts("Contribution submitted by a staff person using contributor's credit card"); - $this->_params['currencyID'] = CRM_Utils_Array::value('currency', - $this->_params, - CRM_Core_Config::singleton()->defaultCurrency - ); + $this->_params['currencyID'] = $this->_params['currency'] ?? CRM_Core_Config::singleton()->defaultCurrency; $this->_params['pcp_display_in_roll'] = $params['pcp_display_in_roll'] ?? NULL; $this->_params['pcp_roll_nickname'] = $params['pcp_roll_nickname'] ?? NULL; diff --git a/CRM/Contribute/Form/ContributionPage/Amount.php b/CRM/Contribute/Form/ContributionPage/Amount.php index 67fd5bca4241..a49217c9badc 100644 --- a/CRM/Contribute/Form/ContributionPage/Amount.php +++ b/CRM/Contribute/Form/ContributionPage/Amount.php @@ -771,12 +771,8 @@ public function postProcess() { foreach ($pledgeBlock as $key) { $pledgeBlockParams[$key] = $params[$key] ?? NULL; } - $pledgeBlockParams['is_pledge_interval'] = CRM_Utils_Array::value('is_pledge_interval', - $params, FALSE - ); - $pledgeBlockParams['pledge_start_date'] = CRM_Utils_Array::value('pledge_start_date', - $params, FALSE - ); + $pledgeBlockParams['is_pledge_interval'] = $params['is_pledge_interval'] ?? FALSE; + $pledgeBlockParams['pledge_start_date'] = $params['pledge_start_date'] ?? FALSE; // create pledge block. CRM_Pledge_BAO_PledgeBlock::create($pledgeBlockParams); } diff --git a/CRM/Financial/Page/AJAX.php b/CRM/Financial/Page/AJAX.php index 183c2f5c7b99..7755fe41419c 100644 --- a/CRM/Financial/Page/AJAX.php +++ b/CRM/Financial/Page/AJAX.php @@ -433,7 +433,7 @@ public static function getFinancialTransactionsList() { ); } if ($financialItem->contact_id) { - $row[$financialItem->id]['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage(!empty($row[$financialItem->id]['contact_sub_type']) ? $row[$financialItem->id]['contact_sub_type'] : CRM_Utils_Array::value('contact_type', $row[$financialItem->id]), FALSE, $financialItem->contact_id); + $row[$financialItem->id]['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage(!empty($row[$financialItem->id]['contact_sub_type']) ? $row[$financialItem->id]['contact_sub_type'] : ($row[$financialItem->id]['contact_type'] ?? NULL), FALSE, $financialItem->contact_id); } // @todo: Is this right? Shouldn't it be adding to the array as we loop? $financialitems = $row;