From fa325ce114d8cadc42c18ec2c959fe1c08cf606d Mon Sep 17 00:00:00 2001 From: colemanw Date: Fri, 13 Oct 2023 19:40:17 -0400 Subject: [PATCH] CRM/Report - Refactor unnecessary uses of CRM_Utils_Array::value --- CRM/Report/BAO/ReportInstance.php | 2 +- CRM/Report/Form.php | 16 +++++----- CRM/Report/Form/Campaign/SurveyDetails.php | 10 +++--- CRM/Report/Form/Case/Demographics.php | 6 ++-- CRM/Report/Form/Case/Detail.php | 4 +-- CRM/Report/Form/Case/TimeSpent.php | 6 ++-- CRM/Report/Form/Contact/CurrentEmployer.php | 6 ++-- CRM/Report/Form/Contact/Detail.php | 6 ++-- CRM/Report/Form/Contact/Log.php | 6 ++-- CRM/Report/Form/Contact/Relationship.php | 14 ++++---- CRM/Report/Form/Contribute/History.php | 10 +++--- .../Form/Contribute/HouseholdSummary.php | 6 ++-- CRM/Report/Form/Contribute/Lybunt.php | 4 +-- .../Form/Contribute/OrganizationSummary.php | 6 ++-- CRM/Report/Form/Contribute/PCP.php | 6 ++-- CRM/Report/Form/Contribute/Repeat.php | 32 +++++++++---------- CRM/Report/Form/Contribute/Sybunt.php | 14 ++++---- CRM/Report/Form/Contribute/TopDonor.php | 6 ++-- CRM/Report/Form/Event/IncomeCountSummary.php | 6 ++-- CRM/Report/Form/Mailing/Bounce.php | 6 ++-- CRM/Report/Form/Mailing/Summary.php | 6 ++-- CRM/Report/Form/Member/Lapse.php | 6 ++-- CRM/Report/Form/Membership/Summary.php | 6 ++-- CRM/Report/Form/Walklist/Walklist.php | 6 ++-- 24 files changed, 98 insertions(+), 98 deletions(-) diff --git a/CRM/Report/BAO/ReportInstance.php b/CRM/Report/BAO/ReportInstance.php index 1e183b19a9..5024788f40 100644 --- a/CRM/Report/BAO/ReportInstance.php +++ b/CRM/Report/BAO/ReportInstance.php @@ -47,7 +47,7 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance implem } if (!$instanceID || !isset($params['id'])) { - $params['is_reserved'] = CRM_Utils_Array::value('is_reserved', $params, FALSE); + $params['is_reserved'] = $params['is_reserved'] ?? FALSE; $params['domain_id'] = CRM_Utils_Array::value('domain_id', $params, CRM_Core_Config::domainID()); // CRM-17256 set created_id on report creation. $params['created_id'] = $params['created_id'] ?? CRM_Core_Session::getLoggedInContactID(); diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 29f0a4dad8..2c2605ce4f 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -1084,7 +1084,7 @@ class CRM_Report_Form extends CRM_Core_Form { $order_by = [ 'column' => $fieldName, 'order' => CRM_Utils_Array::value('default_order', $field, 'ASC'), - 'section' => CRM_Utils_Array::value('default_is_section', $field, 0), + 'section' => $field['default_is_section'] ?? 0, ]; if (!empty($field['default_weight'])) { @@ -3531,8 +3531,9 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND $val[$key] = $options[$valIds]; } } - $pair[$op] = (count($val) == 1) ? (($op == 'notin' || $op == - 'mnot') ? ts('Is Not') : ts('Is')) : CRM_Utils_Array::value($op, $pair); + $pair[$op] = (count($val) == 1) ? + (($op == 'notin' || $op == 'mnot') ? ts('Is Not') : ts('Is')) : + ($pair[$op] ?? ''); $val = implode(', ', $val); $value = "{$pair[$op]} " . $val; } @@ -3540,8 +3541,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND isset($field['options']) && is_array($field['options']) && !empty($field['options']) ) { - $value = ($pair[$op] ?? '') . " " . - CRM_Utils_Array::value($val, $field['options'], $val); + $value = ($pair[$op] ?? '') . ' ' . ($field['options'][$val] ?? $val); } elseif ($val || $val == '0') { $value = ($pair[$op] ?? '') . " " . $val; @@ -3649,8 +3649,8 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND public function compileContent() { $templateFile = $this->getHookedTemplateFileName(); return ($this->_formValues['report_header'] ?? '') . - CRM_Core_Form::$_template->fetch($templateFile) . - CRM_Utils_Array::value('report_footer', $this->_formValues); + CRM_Core_Form::$_template->fetch($templateFile) . + ($this->_formValues['report_footer'] ?? ''); } /** @@ -5038,7 +5038,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a 'is_deceased' => [ 'title' => ts('Deceased'), 'type' => CRM_Utils_Type::T_BOOLEAN, - 'default' => CRM_Utils_Array::value('deceased', $defaults, 0), + 'default' => $defaults['deceased'] ?? 0, ], 'do_not_email' => [ 'title' => ts('Do not email'), diff --git a/CRM/Report/Form/Campaign/SurveyDetails.php b/CRM/Report/Form/Campaign/SurveyDetails.php index 0f8cc4fc34..fe56fbdc80 100644 --- a/CRM/Report/Form/Campaign/SurveyDetails.php +++ b/CRM/Report/Form/Campaign/SurveyDetails.php @@ -318,9 +318,9 @@ class CRM_Report_Form_Campaign_SurveyDetails extends CRM_Report_Form { if ($op) { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } } @@ -357,11 +357,11 @@ class CRM_Report_Form_Campaign_SurveyDetails extends CRM_Report_Form { public function compileContent() { $coverSheet = $this->_surveyCoverSheet() . - "
"; + "
"; $templateFile = $this->getHookedTemplateFileName(); return $coverSheet . CRM_Core_Form::$_template->fetch($templateFile) . - CRM_Utils_Array::value('report_footer', $this->_formValues); + ($this->_formValues['report_footer'] ?? ''); } /** diff --git a/CRM/Report/Form/Case/Demographics.php b/CRM/Report/Form/Case/Demographics.php index bba34f5810..0ef45be865 100644 --- a/CRM/Report/Form/Case/Demographics.php +++ b/CRM/Report/Form/Case/Demographics.php @@ -329,9 +329,9 @@ where (cg.extends='Contact' OR cg.extends='Individual' OR cg.extends_entity_colu else { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } } diff --git a/CRM/Report/Form/Case/Detail.php b/CRM/Report/Form/Case/Detail.php index f6307b1656..bc90feede7 100644 --- a/CRM/Report/Form/Case/Detail.php +++ b/CRM/Report/Form/Case/Detail.php @@ -449,8 +449,8 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { if ($op) { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, CRM_Utils_Array::value("{$fieldName}_max", $this->_params) ); } diff --git a/CRM/Report/Form/Case/TimeSpent.php b/CRM/Report/Form/Case/TimeSpent.php index 432bf8d706..fb929b7a04 100644 --- a/CRM/Report/Form/Case/TimeSpent.php +++ b/CRM/Report/Form/Case/TimeSpent.php @@ -262,9 +262,9 @@ class CRM_Report_Form_Case_TimeSpent extends CRM_Report_Form { else { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } } diff --git a/CRM/Report/Form/Contact/CurrentEmployer.php b/CRM/Report/Form/Contact/CurrentEmployer.php index be2d0ef48c..d04f9b9a08 100644 --- a/CRM/Report/Form/Contact/CurrentEmployer.php +++ b/CRM/Report/Form/Contact/CurrentEmployer.php @@ -249,9 +249,9 @@ FROM civicrm_contact {$this->_aliases['civicrm_contact']} if ($op) { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } } diff --git a/CRM/Report/Form/Contact/Detail.php b/CRM/Report/Form/Contact/Detail.php index ac71cce245..e1348f6c31 100644 --- a/CRM/Report/Form/Contact/Detail.php +++ b/CRM/Report/Form/Contact/Detail.php @@ -606,9 +606,9 @@ HERESQL; $op = $this->_params["{$fieldName}_op"] ?? NULL; $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } if (!empty($clause)) { diff --git a/CRM/Report/Form/Contact/Log.php b/CRM/Report/Form/Contact/Log.php index 65589629d7..652b3ad6a0 100644 --- a/CRM/Report/Form/Contact/Log.php +++ b/CRM/Report/Form/Contact/Log.php @@ -194,9 +194,9 @@ class CRM_Report_Form_Contact_Log extends CRM_Report_Form { if ($op) { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } } diff --git a/CRM/Report/Form/Contact/Relationship.php b/CRM/Report/Form/Contact/Relationship.php index 4cc4512c71..62240a6010 100644 --- a/CRM/Report/Form/Contact/Relationship.php +++ b/CRM/Report/Form/Contact/Relationship.php @@ -485,8 +485,8 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { $clause = $this->whereClause($field, $op, $contactTypes, - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } @@ -496,8 +496,8 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { $subTypeClause = $this->whereClause($field, $op, $contactSubTypes, - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); if ($clause) { $clause = '(' . $clause . ' OR ' . $subTypeClause . ')'; @@ -514,9 +514,9 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { else { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } } diff --git a/CRM/Report/Form/Contribute/History.php b/CRM/Report/Form/Contribute/History.php index fb2141aa22..658db8e0ff 100644 --- a/CRM/Report/Form/Contribute/History.php +++ b/CRM/Report/Form/Contribute/History.php @@ -424,9 +424,9 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { if ($op) { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } } @@ -661,7 +661,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { $total = []; $total['civicrm_contact_sort_name'] = ts('Total'); foreach ($summaryYears as $year) { - $total[$year] = CRM_Utils_Array::value($year, $primaryRow, 0); + $total[$year] = $primaryRow[$year] ?? 0; } $relatedContact = FALSE; @@ -673,7 +673,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { $relatedContact = TRUE; $relatedRow = $relatedContributions[$relcid]; foreach ($summaryYears as $year) { - $total[$year] += CRM_Utils_Array::value($year, $relatedRow, 0); + $total[$year] += $relatedRow[$year] ?? 0; } foreach (array_keys($this->_relationshipColumns) as $col) { diff --git a/CRM/Report/Form/Contribute/HouseholdSummary.php b/CRM/Report/Form/Contribute/HouseholdSummary.php index 474ce68efc..4003b58cee 100644 --- a/CRM/Report/Form/Contribute/HouseholdSummary.php +++ b/CRM/Report/Form/Contribute/HouseholdSummary.php @@ -273,9 +273,9 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { else { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } } diff --git a/CRM/Report/Form/Contribute/Lybunt.php b/CRM/Report/Form/Contribute/Lybunt.php index a8ec850261..ee3c8d808e 100644 --- a/CRM/Report/Form/Contribute/Lybunt.php +++ b/CRM/Report/Form/Contribute/Lybunt.php @@ -644,9 +644,9 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { foreach ($rows as $key => $row) { // The final row contains the totals so we don't need to include it here. if (!empty($row['civicrm_contribution_contact_id'])) { - $display['life_time'] = CRM_Utils_Array::value('life_time', $display) + + $display['life_time'] = ($display['life_time'] ?? 0) + $row['civicrm_contribution_civicrm_life_time_total']; - $display[$previous_year] = CRM_Utils_Array::value($previous_year, $display) + $row['civicrm_contribution_last_year_total_amount']; + $display[$previous_year] = ($display[$previous_year] ?? 0) + $row['civicrm_contribution_last_year_total_amount']; } } diff --git a/CRM/Report/Form/Contribute/OrganizationSummary.php b/CRM/Report/Form/Contribute/OrganizationSummary.php index 109eb68841..ad54d42e08 100644 --- a/CRM/Report/Form/Contribute/OrganizationSummary.php +++ b/CRM/Report/Form/Contribute/OrganizationSummary.php @@ -291,9 +291,9 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form { else { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } } diff --git a/CRM/Report/Form/Contribute/PCP.php b/CRM/Report/Form/Contribute/PCP.php index f3effc38a3..ba48655fa0 100644 --- a/CRM/Report/Form/Contribute/PCP.php +++ b/CRM/Report/Form/Contribute/PCP.php @@ -259,9 +259,9 @@ LEFT JOIN civicrm_event {$this->_aliases['civicrm_event']} if ($op) { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } } diff --git a/CRM/Report/Form/Contribute/Repeat.php b/CRM/Report/Form/Contribute/Repeat.php index f5e33a14ef..ea83b16e7d 100644 --- a/CRM/Report/Form/Contribute/Repeat.php +++ b/CRM/Report/Form/Contribute/Repeat.php @@ -407,9 +407,9 @@ LEFT JOIN $this->tempTableRepeat2 {$this->_aliases['civicrm_contribution']}2 if ($op) { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } } @@ -464,9 +464,9 @@ LEFT JOIN $this->tempTableRepeat2 {$this->_aliases['civicrm_contribution']}2 if ($op) { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } if (!empty($clause)) { @@ -877,15 +877,15 @@ GROUP BY currency // hack to fix title list($from1, $to1) = $this->getFromTo(CRM_Utils_Array::value("receive_date1_relative", $this->_params), - CRM_Utils_Array::value("receive_date1_from", $this->_params), - CRM_Utils_Array::value("receive_date1_to", $this->_params) + $this->_params["receive_date1_from"] ?? NULL, + $this->_params["receive_date1_to"] ?? NULL ); $from1 = CRM_Utils_Date::customFormat($from1, NULL, ['d']); $to1 = CRM_Utils_Date::customFormat($to1, NULL, ['d']); list($from2, $to2) = $this->getFromTo(CRM_Utils_Array::value("receive_date2_relative", $this->_params), - CRM_Utils_Array::value("receive_date2_from", $this->_params), - CRM_Utils_Array::value("receive_date2_to", $this->_params) + $this->_params["receive_date2_from"] ?? NULL, + $this->_params["receive_date2_to"] ?? NULL ); $from2 = CRM_Utils_Date::customFormat($from2, NULL, ['d']); $to2 = CRM_Utils_Date::customFormat($to2, NULL, ['d']); @@ -914,13 +914,13 @@ GROUP BY currency * Rows generated by SQL, with an array for each row. */ public function alterDisplay(&$rows) { - list($from1, $to1) = $this->getFromTo(CRM_Utils_Array::value("receive_date1_relative", $this->_params), - CRM_Utils_Array::value("receive_date1_from", $this->_params), - CRM_Utils_Array::value("receive_date1_to", $this->_params) + [$from1, $to1] = $this->getFromTo(CRM_Utils_Array::value("receive_date1_relative", $this->_params), + $this->_params["receive_date1_from"] ?? NULL, + $this->_params["receive_date1_to"] ?? NULL ); - list($from2, $to2) = $this->getFromTo(CRM_Utils_Array::value("receive_date2_relative", $this->_params), - CRM_Utils_Array::value("receive_date2_from", $this->_params), - CRM_Utils_Array::value("receive_date2_to", $this->_params) + [$from2, $to2] = $this->getFromTo(CRM_Utils_Array::value("receive_date2_relative", $this->_params), + $this->_params["receive_date2_from"] ?? NULL, + $this->_params["receive_date2_to"] ?? NULL ); $dateUrl = ""; diff --git a/CRM/Report/Form/Contribute/Sybunt.php b/CRM/Report/Form/Contribute/Sybunt.php index ed9a2080a1..318e007cac 100644 --- a/CRM/Report/Form/Contribute/Sybunt.php +++ b/CRM/Report/Form/Contribute/Sybunt.php @@ -370,9 +370,9 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { if ($op) { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); if (($fieldName == 'contribution_status_id' || $fieldName == 'financial_type_id') && !empty($clause) @@ -526,13 +526,13 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { foreach ($rows as $key => $row) { $display["upto_{$upto}"] - = CRM_Utils_Array::value("upto_{$upto}", $display) + CRM_Utils_Array::value("civicrm_upto_{$upto}", $row); + = ($display["upto_{$upto}"] ?? 0) + ($row["civicrm_upto_{$upto}"] ?? 0); $display[$previous_year] - = CRM_Utils_Array::value($previous_year, $display) + CRM_Utils_Array::value($previous_year, $row); + = ($display[$previous_year] ?? 0) + ($row[$previous_year] ?? 0); $display[$previous_two_year] - = CRM_Utils_Array::value($previous_two_year, $display) + CRM_Utils_Array::value($previous_two_year, $row); + = ($display[$previous_two_year] ?? 0) + ($row[$previous_two_year] ?? 0); $display[$previous_three_year] - = CRM_Utils_Array::value($previous_three_year, $display) + CRM_Utils_Array::value($previous_three_year, $row); + = ($display[$previous_three_year] ?? 0) + ($row[$previous_three_year] ?? 0); } $graphRows['value'] = $display; diff --git a/CRM/Report/Form/Contribute/TopDonor.php b/CRM/Report/Form/Contribute/TopDonor.php index 0dcff4a211..6d2f7beb75 100644 --- a/CRM/Report/Form/Contribute/TopDonor.php +++ b/CRM/Report/Form/Contribute/TopDonor.php @@ -266,9 +266,9 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form { if ($op) { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } } diff --git a/CRM/Report/Form/Event/IncomeCountSummary.php b/CRM/Report/Form/Event/IncomeCountSummary.php index e42e0036fa..d0865aa4ea 100644 --- a/CRM/Report/Form/Event/IncomeCountSummary.php +++ b/CRM/Report/Form/Event/IncomeCountSummary.php @@ -218,9 +218,9 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form { if ($op) { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } } diff --git a/CRM/Report/Form/Mailing/Bounce.php b/CRM/Report/Form/Mailing/Bounce.php index ebe9d1a846..67bd05b1ad 100644 --- a/CRM/Report/Form/Mailing/Bounce.php +++ b/CRM/Report/Form/Mailing/Bounce.php @@ -349,9 +349,9 @@ class CRM_Report_Form_Mailing_Bounce extends CRM_Report_Form { if ($op) { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } diff --git a/CRM/Report/Form/Mailing/Summary.php b/CRM/Report/Form/Mailing/Summary.php index d2e4e61942..7125920631 100644 --- a/CRM/Report/Form/Mailing/Summary.php +++ b/CRM/Report/Form/Mailing/Summary.php @@ -436,9 +436,9 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { else { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } } diff --git a/CRM/Report/Form/Member/Lapse.php b/CRM/Report/Form/Member/Lapse.php index 236c4cd309..d2443dd7e3 100644 --- a/CRM/Report/Form/Member/Lapse.php +++ b/CRM/Report/Form/Member/Lapse.php @@ -232,9 +232,9 @@ class CRM_Report_Form_Member_Lapse extends CRM_Report_Form { if ($op) { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } } diff --git a/CRM/Report/Form/Membership/Summary.php b/CRM/Report/Form/Membership/Summary.php index 4ba26fb9d8..68fc16695c 100644 --- a/CRM/Report/Form/Membership/Summary.php +++ b/CRM/Report/Form/Membership/Summary.php @@ -197,9 +197,9 @@ LEFT JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} if ($op) { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } } diff --git a/CRM/Report/Form/Walklist/Walklist.php b/CRM/Report/Form/Walklist/Walklist.php index 14b40773b3..de15f85827 100644 --- a/CRM/Report/Form/Walklist/Walklist.php +++ b/CRM/Report/Form/Walklist/Walklist.php @@ -130,9 +130,9 @@ FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom if ($op) { $clause = $this->whereClause($field, $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) + $this->_params["{$fieldName}_value"] ?? NULL, + $this->_params["{$fieldName}_min"] ?? NULL, + $this->_params["{$fieldName}_max"] ?? NULL ); } } -- 2.25.1