From bc210cda3f153ec6de3e132ef099d508bf3540e0 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Fri, 18 Jun 2021 06:32:59 +0000 Subject: [PATCH] [php8-compact] Fix APIv4 Group Concat Test by setting dataType to be NULL if the first expression is a SQL Function --- Civi/Api4/Query/SqlFunctionGROUP_CONCAT.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Civi/Api4/Query/SqlFunctionGROUP_CONCAT.php b/Civi/Api4/Query/SqlFunctionGROUP_CONCAT.php index 1b52b941b5..0e0f7525b8 100644 --- a/Civi/Api4/Query/SqlFunctionGROUP_CONCAT.php +++ b/Civi/Api4/Query/SqlFunctionGROUP_CONCAT.php @@ -59,6 +59,10 @@ class SqlFunctionGROUP_CONCAT extends SqlFunction { // By default, values are split into an array and formatted according to the field's dataType if (!$exprArgs[2]['prefix']) { $value = explode(\CRM_Core_DAO::VALUE_SEPARATOR, $value); + // If the first expression is another sqlFunction then unset $dataType to preserve raw string + if ($exprArgs[0]['expr'][0] instanceof SqlFunction) { + $dataType = NULL; + } } // If using custom separator, unset $dataType to preserve raw string else { -- 2.25.1