diff options
author | diosmosis <benaka@piwik.pro> | 2014-11-16 03:06:05 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2014-11-16 03:06:05 +0300 |
commit | e130d9d6ad6d2ba6edc0e2af1a9aa8f548d94b9b (patch) | |
tree | a7259f218c949897883952757a2ed97ddec3ee8c /core/DataTable | |
parent | ebce0b377b825a61b1e0bc7a136fd20ad24bdbe3 (diff) | |
parent | 4e5610aba57e03d375e8671ec4d90788e8efc70c (diff) |
Merge branch 'master' into processed_metrics_metadata
Conflicts:
core/Twig.php
Diffstat (limited to 'core/DataTable')
-rwxr-xr-x | core/DataTable/Filter/GroupBy.php | 2 | ||||
-rw-r--r-- | core/DataTable/Row.php | 17 |
2 files changed, 15 insertions, 4 deletions
diff --git a/core/DataTable/Filter/GroupBy.php b/core/DataTable/Filter/GroupBy.php index 9391ccd95f..2ac79a6de9 100755 --- a/core/DataTable/Filter/GroupBy.php +++ b/core/DataTable/Filter/GroupBy.php @@ -10,6 +10,7 @@ namespace Piwik\DataTable\Filter; use Piwik\DataTable; use Piwik\DataTable\BaseFilter; +use Piwik\DataTable\Row; /** * DataTable filter that will group {@link DataTable} rows together based on the results @@ -71,6 +72,7 @@ class GroupBy extends BaseFilter */ public function filter($table) { + /** @var Row[] $groupByRows */ $groupByRows = array(); $nonGroupByRowIds = array(); diff --git a/core/DataTable/Row.php b/core/DataTable/Row.php index a90855a1d9..c6c0d21e9f 100644 --- a/core/DataTable/Row.php +++ b/core/DataTable/Row.php @@ -640,10 +640,7 @@ class Row implements \ArrayAccess, \IteratorAggregate return $newValue; } - if (is_string($columnToSumValue)) { - throw new Exception("Trying to add two strings in DataTable\Row::sumRowArray: " - . "'$thisColumnValue' + '$columnToSumValue'" . " for row " . $this->__toString()); - } + $this->warnWhenSummingTwoStrings($thisColumnValue, $columnToSumValue); return 0; } @@ -761,4 +758,16 @@ class Row implements \ArrayAccess, \IteratorAggregate } } + protected function warnWhenSummingTwoStrings($thisColumnValue, $columnToSumValue) + { + if (is_string($columnToSumValue)) { + Log::warning( + "Trying to add two strings in DataTable\Row::sumRowArray: %s + %s for row %s", + $thisColumnValue, + $columnToSumValue, + $this->__toString() + ); + } + } + } |