From 9787b4e855124f80ec3ff88d474dd127b83eb489 Mon Sep 17 00:00:00 2001 From: Jacob Ransom Date: Mon, 9 Sep 2024 17:10:45 +1200 Subject: [PATCH] Adding check for core version to avoid requiring minimum version increase --- RecordBuilders/CustomVariables.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/RecordBuilders/CustomVariables.php b/RecordBuilders/CustomVariables.php index 9866d5e..c94b796 100644 --- a/RecordBuilders/CustomVariables.php +++ b/RecordBuilders/CustomVariables.php @@ -21,6 +21,7 @@ use Piwik\Plugins\CustomVariables\Archiver; use Piwik\Plugins\CustomVariables\Model; use Piwik\Tracker\GoalManager; +use Piwik\Version; class CustomVariables extends RecordBuilder { @@ -94,7 +95,9 @@ protected function aggregateCustomVariable(DataTable $record, array &$metadata, $query = $logAggregator->queryActionsByDimension($dimensions, $where, $additionalSelects); $this->aggregateFromActions($record, $metadata, $metadataFlat, $query, $keyField, $valueField); - $query = $logAggregator->queryConversionsByDimension($dimensions, $where, [], [], false, false, true); + $query = version_compare(Version::VERSION, '5.2.0-b1', '>=') + ? $logAggregator->queryConversionsByDimension($dimensions, $where, [], [], false, false, true) + : $logAggregator->queryConversionsByDimension($dimensions, $where); $this->aggregateFromConversions($record, $query, $keyField, $valueField); }