Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Giehl <stefan@matomo.org>2020-01-27 23:26:31 +0300
committerThomas Steur <tsteur@users.noreply.github.com>2020-01-27 23:26:31 +0300
commit1dd8fb90267dc55f947f005d091bb7876310a7d6 (patch)
tree7d22f00aebd77bd58194e54f20441c8c59f17e78 /plugins
parent804237dfd49c2bfb0de570ae4df7f9a976213cee (diff)
Fix possible warning for columns without index (#15467)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/CoreVisualizations/Visualizations/HtmlTable.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/CoreVisualizations/Visualizations/HtmlTable.php b/plugins/CoreVisualizations/Visualizations/HtmlTable.php
index 21116fefb9..d78702b87f 100644
--- a/plugins/CoreVisualizations/Visualizations/HtmlTable.php
+++ b/plugins/CoreVisualizations/Visualizations/HtmlTable.php
@@ -225,9 +225,10 @@ class HtmlTable extends Visualization
foreach ($this->dataTable->getRows() as $row) {
foreach ($this->report->getMetrics() as $column => $translation) {
- $indexColumn = $columnNamesToIndices[$column]; // TODO: This might fail for goal specific columns...
+ // Try to check the column by it's index (not possible for all metrics, like custom columns)
+ $indexColumn = !empty($columnNamesToIndices[$column]) ? $columnNamesToIndices[$column] : null;
- $value = $row->getColumn($indexColumn) ?: $row->getColumn($column) ?: 0;
+ $value = ($indexColumn && $row->getColumn($indexColumn)) ? $row->getColumn($indexColumn) : $row->getColumn($column) ?: 0;
if ($column == 'label') {
continue;
}