From dbed69ca12d3c128c145000158846c4d0a2f958d Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Fri, 20 Sep 2019 11:49:04 -0400 Subject: [PATCH 1/2] Fix missing auto_increment --- CRM/RelateEntities/Settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/RelateEntities/Settings.php b/CRM/RelateEntities/Settings.php index e0ba180..4a040a9 100644 --- a/CRM/RelateEntities/Settings.php +++ b/CRM/RelateEntities/Settings.php @@ -5,7 +5,7 @@ class CRM_RelateEntities_Settings { public static function install() { CRM_Core_DAO::executeQuery(" CREATE TABLE IF NOT EXISTS `civicrm_relate_entities` ( - `id` int(10) UNSIGNED NOT NULL, + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `entity_table_a` varchar(255) NOT NULL, `entity_table_b` varchar(255) NOT NULL, `entity_id_a` int(10) UNSIGNED NOT NULL, -- 2.45.2 From 31cc8d3d0648f81d4eacd099c675bd0c2b4c88ef Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Fri, 20 Sep 2019 11:49:15 -0400 Subject: [PATCH 2/2] Fix FGB error --- CRM/RelateEntities/Utils.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CRM/RelateEntities/Utils.php b/CRM/RelateEntities/Utils.php index d529ee2..558449e 100644 --- a/CRM/RelateEntities/Utils.php +++ b/CRM/RelateEntities/Utils.php @@ -208,13 +208,15 @@ class CRM_RelateEntities_Utils { ) AS temp $groupByClause "; - + CRM_Core_DAO::disableFullGroupByMode(); if ($getCount) { - return CRM_Core_DAO::singleValueQuery($query, $queryParams); + $result = CRM_Core_DAO::singleValueQuery($query, $queryParams); } else { - return CRM_Core_DAO::executeQuery($query, $queryParams); + $result = CRM_Core_DAO::executeQuery($query, $queryParams); } + CRM_Core_DAO::reenableFullGroupByMode(); + return $result; } } -- 2.45.2