From 1519acb5b67e7fa877ff8cf731ea1b0d90b1cf0a Mon Sep 17 00:00:00 2001 From: sgiehl Date: Thu, 12 Sep 2024 10:05:37 +0200 Subject: [PATCH] Ensure grouping a dimension in ms doesn't fail if ranking query limit is reached --- core/Columns/Dimension.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/Columns/Dimension.php b/core/Columns/Dimension.php index c77099b9fea..6801c05507a 100644 --- a/core/Columns/Dimension.php +++ b/core/Columns/Dimension.php @@ -419,6 +419,10 @@ public function groupValue($value, $idSite) case Dimension::TYPE_BOOL: return !empty($value) ? '1' : '0'; case Dimension::TYPE_DURATION_MS: + if (!is_numeric($value)) { + // This might happen if ranking query has too many results and `__mtm_ranking_query_others__` is returned + return $value; + } return round($value / 1000, 2) * 1000; // because we divide we need to group them and cannot do this in formatting step } return $value;