diff options
author | Ben Burgess <88810029+bx80@users.noreply.github.com> | 2022-05-31 09:34:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-31 09:34:42 +0300 |
commit | 5ee8fb2829302b9d84549faacc2137039f21bc75 (patch) | |
tree | d9d850e3d884c56d0a7c8bffc2abef884c0d32e5 /plugins/CoreVisualizations | |
parent | 25417ad294bb016a472da302de3db291898810a7 (diff) |
Fix for undefined array index error when rendering sparklines. (#19294)
Diffstat (limited to 'plugins/CoreVisualizations')
-rw-r--r-- | plugins/CoreVisualizations/Visualizations/Sparklines.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/CoreVisualizations/Visualizations/Sparklines.php b/plugins/CoreVisualizations/Visualizations/Sparklines.php index dd68566de4..fac81dd033 100644 --- a/plugins/CoreVisualizations/Visualizations/Sparklines.php +++ b/plugins/CoreVisualizations/Visualizations/Sparklines.php @@ -289,7 +289,10 @@ class Sparklines extends ViewDataTable $metrics = []; foreach ($values as $i => $value) { - if ($columnMetrics[$column[$i]]) { + if (!isset($column[$i])) { + continue; + } + if (isset($columnMetrics[$column[$i]]) && $columnMetrics[$column[$i]]) { $value = $columnMetrics[$column[$i]]->format($value, $metricFormatter); } elseif (strpos($column[$i], 'revenue') !== false && $idSite > 0) { $value = $metricFormatter->getPrettyMoney($value, $idSite); |