From f9d8a5d10a4641e646ea179406f2dc1dcbf80a63 Mon Sep 17 00:00:00 2001 From: kurund Date: Sat, 17 May 2014 23:24:55 -0500 Subject: [PATCH] ignore uf_join module for reserved profiles CRM-14488 ---------------------------------------- * CRM-14488: https://issues.civicrm.org/jira/browse/CRM-14488 --- CRM/Core/BAO/UFGroup.php | 6 +++--- CRM/Profile/Page/Dynamic.php | 2 +- CRM/Profile/Page/View.php | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index 93a254b31c..9448758c19 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -297,10 +297,10 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { $gids = implode(',', $profileIds); $params = array(); if ($restrict) { - $query = "SELECT g.* from civicrm_uf_group g, civicrm_uf_join j + $query = "SELECT g.* from civicrm_uf_group g + LEFT JOIN civicrm_uf_join j ON (j.uf_group_id = g.id) WHERE g.id IN ( {$gids} ) - AND j.uf_group_id IN ( {$gids} ) - AND j.module = %1 + AND ((j.uf_group_id IN ( {$gids} ) AND j.module = %1) OR g.is_reserved = 1 ) "; $params = array(1 => array($restrict, 'String')); } diff --git a/CRM/Profile/Page/Dynamic.php b/CRM/Profile/Page/Dynamic.php index cfe5561307..c5a5c71eb0 100644 --- a/CRM/Profile/Page/Dynamic.php +++ b/CRM/Profile/Page/Dynamic.php @@ -115,7 +115,7 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { * @param null $profileIds * * @return \CRM_Profile_Page_Dynamic - @access public + * @access public */ function __construct($id, $gid, $restrict, $skipPermission = FALSE, $profileIds = NULL) { parent::__construct(); diff --git a/CRM/Profile/Page/View.php b/CRM/Profile/Page/View.php index 4472ec3438..39ff03348d 100644 --- a/CRM/Profile/Page/View.php +++ b/CRM/Profile/Page/View.php @@ -60,7 +60,8 @@ class CRM_Profile_Page_View extends CRM_Core_Page { * @return void * @access public * - */ function preProcess() { + */ + function preProcess() { $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE ); -- 2.25.1