diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2020-02-16 22:51:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-16 22:51:15 +0300 |
commit | 11a82f670787cb3bdb80ba8db2b9f96efedfda1f (patch) | |
tree | 3b358a946b91abd4dcc94bce90e911bd3b6ce254 /plugins/CoreVisualizations/Visualizations | |
parent | a19d8cf6a4251644c4e9d24c4be23b61a409ed03 (diff) |
Fix non-numeric value encountered in session recording (#15569)
Diffstat (limited to 'plugins/CoreVisualizations/Visualizations')
-rw-r--r-- | plugins/CoreVisualizations/Visualizations/HtmlTable.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/CoreVisualizations/Visualizations/HtmlTable.php b/plugins/CoreVisualizations/Visualizations/HtmlTable.php index 42c0798fbf..ba3bb6b98a 100644 --- a/plugins/CoreVisualizations/Visualizations/HtmlTable.php +++ b/plugins/CoreVisualizations/Visualizations/HtmlTable.php @@ -235,9 +235,11 @@ class HtmlTable extends Visualization $reportTotal = isset($totals[$column]) ? $totals[$column] : 0; - $percentageColumnName = $column . '_row_percentage'; - $rowPercentage = $formatter->formatPercent(Piwik::getPercentageSafe($value, $reportTotal, $precision = 1), $precision); - $row->setMetadata($percentageColumnName, $rowPercentage); + if (is_numeric($value)) { + $percentageColumnName = $column . '_row_percentage'; + $rowPercentage = $formatter->formatPercent(Piwik::getPercentageSafe($value, $reportTotal, $precision = 1), $precision); + $row->setMetadata($percentageColumnName, $rowPercentage); + } if ($siteTotalRow) { $siteTotal = $siteTotalRow->getColumn($column) ?: 0; |