From 1d0d5affe73a20d380379e23084c6153ec38afe8 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 5 Sep 2014 14:07:08 +1200 Subject: [PATCH] CRM-15237 also fix e-notices on event summary report --- CRM/Report/Form/Event/IncomeCountSummary.php | 4 +++- tests/phpunit/api/v3/ReportTemplateTest.php | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CRM/Report/Form/Event/IncomeCountSummary.php b/CRM/Report/Form/Event/IncomeCountSummary.php index cd3ba9a405..db26a78998 100644 --- a/CRM/Report/Form/Event/IncomeCountSummary.php +++ b/CRM/Report/Form/Event/IncomeCountSummary.php @@ -67,6 +67,7 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event { 'required' => TRUE, ), 'id' => array( + 'title' => 'Event ID', 'no_display' => TRUE, 'required' => TRUE, ), @@ -268,6 +269,7 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event { $dao = CRM_Core_DAO::executeQuery($sql); if ($dao->fetch()) { + $avg = 0; if ($dao->count && $dao->amount) { $avg = $dao->amount / $dao->count; } @@ -281,7 +283,7 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event { 'title' => 'Total Income', 'type' => CRM_Utils_Type::T_MONEY, ); - $statistics['counts']['avg '] = array( + $statistics['counts']['avg'] = array( 'value' => $avg, 'title' => 'Average', 'type' => CRM_Utils_Type::T_MONEY, diff --git a/tests/phpunit/api/v3/ReportTemplateTest.php b/tests/phpunit/api/v3/ReportTemplateTest.php index add5c2b5f3..5ed5c0ae8b 100644 --- a/tests/phpunit/api/v3/ReportTemplateTest.php +++ b/tests/phpunit/api/v3/ReportTemplateTest.php @@ -181,7 +181,6 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase { 'contribute/lybunt' => 'same as sybunt - fatals on force url & test identifies why', 'event/income' => 'I do no understant why but error is Call to undefined method CRM_Report_Form_Event_Income::from() in CRM/Report/Form.php on line 2120', 'contact/relationship' => '(see contribute/repeat), property declaration issue, Undefined property: CRM_Report_Form_Contact_Relationship::$relationType in /Contact/Relationship.php(486):', - 'event/incomesummary' => 'Undefined index: title, Report/Form/Event/IncomeCountSummary.php(187)', 'logging/contact/summary' => '(likely to be test releated) probably logging off Undefined index: Form/Contact/LoggingSummary.php(231): PHP', 'logging/contact/detail' => '(likely to be test releated) probably logging off DB Error: no such table', 'logging/contribute/summary' => '(likely to be test releated) probably logging off DB Error: no such table', -- 2.25.1