Skip to content

Commit

Permalink
Merge pull request #20655 from seamuslee001/fix_apiv4_group_concat_php8
Browse files Browse the repository at this point in the history
[php8-compact] Fix APIv4 Group Concat Test by setting dataType to be …
  • Loading branch information
seamuslee001 authored Jun 18, 2021
2 parents daa0be9 + bc210cd commit bbb01e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Civi/Api4/Query/SqlFunctionGROUP_CONCAT.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ public function formatOutputValue($value, &$dataType) {
// 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 {
Expand Down

0 comments on commit bbb01e6

Please sign in to comment.