From 6167c3d3ffa7783a6328e7a3b67b21f11cc9ff39 Mon Sep 17 00:00:00 2001 From: Brian Shaughnessy Date: Mon, 16 Mar 2015 20:58:41 -0400 Subject: [PATCH] CRM-16123 suppress PCP if target entity inactive --- CRM/PCP/BAO/PCP.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CRM/PCP/BAO/PCP.php b/CRM/PCP/BAO/PCP.php index 3fe68eba08..7d810a7b1f 100644 --- a/CRM/PCP/BAO/PCP.php +++ b/CRM/PCP/BAO/PCP.php @@ -213,13 +213,13 @@ ORDER BY target_entity_type, target_entity_id $action = CRM_Core_Action::formLink($pcpLink, $mask, $replace, ts('more'), FALSE, 'pcp.dashboard.other', "{$pcpBlockDao->target_entity_type}_PCP", $pcpBlockDao->target_entity_id); $component = $pcpBlockDao->target_entity_type; - $pageTitle = CRM_Utils_Array::value($pcpBlockDao->target_entity_id, $$component); - $pcpBlock[] = array( - 'pageId' => $pcpBlockDao->target_entity_id, - 'pageTitle' => $pageTitle, - 'component' => $pcpBlockDao->target_entity_type, - 'action' => $action, - ); + if ($pageTitle = CRM_Utils_Array::value($pcpBlockDao->target_entity_id, $$component)) { + $pcpBlock[] = array( + 'pageId' => $pcpBlockDao->target_entity_id, + 'pageTitle' => $pageTitle, + 'action' => $action, + ); + } } return array($pcpBlock, $pcpInfo); -- 2.25.1