diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2015-03-16 04:11:56 +0300 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2015-03-16 04:11:56 +0300 |
commit | a8e21f325eb96bd0df4131b914a5e17473abca7f (patch) | |
tree | 050cae07f188cd87daac0ef0e83d2c001fcf7631 /core/ArchiveProcessor.php | |
parent | ca2f0d3047cee0e084bf02d1e6bae4761eb7c3c0 (diff) |
do not rename columns twice when aggregating dataTable records
Diffstat (limited to 'core/ArchiveProcessor.php')
-rw-r--r-- | core/ArchiveProcessor.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/ArchiveProcessor.php b/core/ArchiveProcessor.php index 58282e72d1..cb24d83367 100644 --- a/core/ArchiveProcessor.php +++ b/core/ArchiveProcessor.php @@ -344,7 +344,10 @@ class ArchiveProcessor // By default we shall aggregate all sub-tables. $dataTable = $this->getArchive()->getDataTableExpanded($name, $idSubTable = null, $depth = null, $addMetadataSubtableId = false); + $columnsRenamed = false; + if ($dataTable instanceof Map) { + $columnsRenamed = true; // see https://github.com/piwik/piwik/issues/4377 $self = $this; $dataTable->filter(function ($table) use ($self, $columnsToRenameAfterAggregation) { @@ -353,7 +356,11 @@ class ArchiveProcessor } $dataTable = $this->getAggregatedDataTableMap($dataTable, $columnsAggregationOperation); - $this->renameColumnsAfterAggregation($dataTable, $columnsToRenameAfterAggregation); + + if (!$columnsRenamed) { + $this->renameColumnsAfterAggregation($dataTable, $columnsToRenameAfterAggregation); + } + return $dataTable; } |