From fae6de7ca2eec1b4a3de2a1886c32fb91aa06970 Mon Sep 17 00:00:00 2001 From: Joseph Lacey Date: Wed, 23 Mar 2016 18:16:00 -0400 Subject: [PATCH] CRM-18276 Fixing truncated custom data tables array with GROUP_CONCAT ---------------------------------------- * CRM-18276: Report custom data table retrieval fails when tables are more than 1024 characters https://issues.civicrm.org/jira/browse/CRM-18276 --- CRM/Report/Form.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index ebbe3f01ee..8a41ce49e7 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -3658,7 +3658,12 @@ ORDER BY cg.weight, cf.weight"; return; } $mapper = CRM_Core_BAO_CustomQuery::$extendsMap; - $customTables = explode(',', CRM_Core_DAO::singleValueQuery("SELECT GROUP_CONCAT(table_name) FROM civicrm_custom_group")); + //CRM-18276 GROUP_CONCAT could be used with singleValueQuery and then exploded, + //but by default that truncates to 1024 characters, which causes errors with installs with lots of custom field sets + $customTablesDAO = CRM_Core_DAO::executeQuery("SELECT table_name FROM civicrm_custom_group", CRM_Core_DAO::$_nullArray); + while ($customTablesDAO->fetch()) { + $customTables[] = $customTablesDAO->table_name; + } foreach ($this->_columns as $table => $prop) { if (in_array($table, $customTables)) { -- 2.25.1