From 6221462fa2d7ae018799176462add775141a0cf8 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 5 Sep 2014 13:50:33 +1200 Subject: [PATCH] CRM-15237 fix enotice --- CRM/Report/Form/ActivitySummary.php | 5 ++--- tests/phpunit/api/v3/ReportTemplateTest.php | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CRM/Report/Form/ActivitySummary.php b/CRM/Report/Form/ActivitySummary.php index f77c374758..9e0e783c74 100644 --- a/CRM/Report/Form/ActivitySummary.php +++ b/CRM/Report/Form/ActivitySummary.php @@ -193,8 +193,8 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form { if (array_key_exists('group_bys', $table)) { foreach ($table['group_bys'] as $fieldName => $field) { if (!empty($this->_params['group_bys'][$fieldName])) { - - switch (CRM_Utils_Array::value($fieldName, $this->_params['group_bys_freq'])) { + if (isset($this->_params['group_bys_freq']) && !empty($this->_params['group_bys_freq'][$fieldName])) { + switch ($this->_params['group_bys_freq'][$fieldName]) { case 'YEARWEEK': $select[] = "DATE_SUB({$field['dbAlias']}, INTERVAL WEEKDAY({$field['dbAlias']}) DAY) AS {$tableName}_{$fieldName}_start"; @@ -224,7 +224,6 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form { $field['title'] = 'Quarter'; break; } - if (!empty($this->_params['group_bys_freq'][$fieldName])) { $this->_interval = $field['title']; $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['title'] = $field['title'] . ' Beginning'; $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['type'] = $field['type']; diff --git a/tests/phpunit/api/v3/ReportTemplateTest.php b/tests/phpunit/api/v3/ReportTemplateTest.php index 355080c602..add5c2b5f3 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):', - 'activitySummary' => 'Undefined index: group_bys_freq m/ActivitySummary.php(191)', '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', -- 2.25.1