From 743f5cb2384719b4be46a84cb1092896494a7a0e Mon Sep 17 00:00:00 2001 From: Frederic Guzman Date: Tue, 6 Sep 2016 16:02:39 -0400 Subject: [PATCH] Block ID and PCP ID are bugging result on getPcpDashboardInfo function Now you can peek, this query is looking for PCP in database, and showing all tables of civicrm_pcp and civicrm_pcp_block, this include their "ID", it can be fail because depend the configuration of database server the result, i mean, the server will select between pcp_block's(table) ID or pcp's(table) ID(In my case, my database server, selected the block ID instead of PCP ID), it's bad because pcp(table) and pcp_block(table) they has the same ID field name, but, it's good structure schema in database, the problem is the query, and can be solve. --- CRM/PCP/BAO/PCP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/PCP/BAO/PCP.php b/CRM/PCP/BAO/PCP.php index 1c1ce614cf..c4e9eacf60 100644 --- a/CRM/PCP/BAO/PCP.php +++ b/CRM/PCP/BAO/PCP.php @@ -117,7 +117,7 @@ WHERE civicrm_pcp.contact_id = civicrm_contact.id $links = self::pcpLinks(); $query = " -SELECT * FROM civicrm_pcp pcp +SELECT pcp.*, block.is_tellfriend_enabled FROM civicrm_pcp pcp LEFT JOIN civicrm_pcp_block block ON block.id = pcp.pcp_block_id WHERE pcp.is_active = 1 AND pcp.contact_id = %1 -- 2.25.1