ignore uf_join module for reserved profiles CRM-14488
authorkurund <kurund@civicrm.org>
Sun, 18 May 2014 04:24:55 +0000 (23:24 -0500)
committerkurund <kurund@civicrm.org>
Mon, 19 May 2014 05:34:02 +0000 (11:04 +0530)
----------------------------------------
* CRM-14488:
  https://issues.civicrm.org/jira/browse/CRM-14488

CRM/Core/BAO/UFGroup.php
CRM/Profile/Page/Dynamic.php
CRM/Profile/Page/View.php

index 93a254b31c6fdfe86d5ef33f6b03c2aae7179f79..9448758c1917086c2bd960cf4fe41002b1779b4d 100644 (file)
@@ -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'));
     }
index cfe5561307c59ba32dcc109bc211c196f070433e..c5a5c71eb0832934b4ab1c6585b3f3045915267a 100644 (file)
@@ -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();
index 4472ec3438edb31e16623cee18a9635b0cd9a55f..39ff03348d341b7f335ed07acbf10efdb0310a5b 100644 (file)
@@ -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
     );