From a79da2c519c20bb603a6d97e6fa2d3e0c471540f Mon Sep 17 00:00:00 2001
From: diosmosis <benaka@piwik.pro>
Date: Sun, 21 Sep 2014 11:48:13 -0700
Subject: [PATCH] Refs #6078, fix column ordering bug, if 0 is used as pivotted
 table column, it is ordered first and not prepended.

---
 core/DataTable/Filter/PivotByDimension.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/core/DataTable/Filter/PivotByDimension.php b/core/DataTable/Filter/PivotByDimension.php
index 225a33f0bb..2f4e733ea0 100644
--- a/core/DataTable/Filter/PivotByDimension.php
+++ b/core/DataTable/Filter/PivotByDimension.php
@@ -452,7 +452,7 @@ class PivotByDimension extends BaseFilter
         $columnSet = array_map(function () { return false; }, $columnSet);
 
         // make sure label column is first
-        $columnSet = array_merge(array('label' => false), $columnSet);
+        $columnSet = array('label' => false) + $columnSet;
 
         return $columnSet;
     }
@@ -466,8 +466,8 @@ class PivotByDimension extends BaseFilter
 
         $currentIndex = 1;
         foreach ($defaultRow as $columnName => $ignore) {
-            if ($columnName == $othersRowLabel
-                || $columnName == 'label'
+            if ($columnName === $othersRowLabel
+                || $columnName === 'label'
             ) {
                 $result[] = $columnName;
             } else {
-- 
GitLab