diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2011-04-19 08:17:15 +0400 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2011-04-19 08:17:15 +0400 |
commit | d63ae1887ec5b9032a3b3900b612eeae954ec994 (patch) | |
tree | 95ff4e81a0524d95469941b1879dbe0eb47fe7ac /core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php | |
parent | c5ab908196786e84ee6b0f207f223a9fad5675bc (diff) |
Fixes Warning: Division by zero in trunk\core\DataTable\Filter\AddColumnsProcessedMetricsGoal.php on line 80
git-svn-id: http://dev.piwik.org/svn/trunk@4509 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php')
-rw-r--r-- | core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php b/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php index d662201498..f177d49a02 100644 --- a/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php +++ b/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php @@ -76,7 +76,12 @@ class Piwik_DataTable_Filter_AddColumnsProcessedMetricsGoal extends Piwik_DataTa // If no visit for this metric, but some conversions, we still want to display some kind of "revenue per visit" // even though it will actually be in this edge case "Revenue per conversion" - $revenuePerVisit = round( $revenue / ($nbVisits == 0 ? $conversions : $nbVisits), $roundingPrecision ); + $revenuePerVisit = $this->invalidDivision; + if($nbVisits > 0 + || $conversions > 0) + { + $revenuePerVisit = round( $revenue / ($nbVisits == 0 ? $conversions : $nbVisits), $roundingPrecision ); + } $newColumns['revenue_per_visit'] = $revenuePerVisit; if($this->processOnlyIdGoal == self::GOALS_MINIMAL_REPORT) |