From ff4f77441a1f0bee0a9531119778365dc375bcbe Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 31 May 2013 13:01:18 -0700 Subject: [PATCH] uf_group pseudoConstant fix CRM-12464 ---------------------------------------- * CRM-12464: Add PseudoConstants to Schema Metadata http://issues.civicrm.org/jira/browse/CRM-12464 --- CRM/ACL/Form/ACL.php | 2 +- CRM/ACL/Page/ACL.php | 2 +- CRM/Core/BAO/UFGroup.php | 6 +++--- CRM/Core/Permission.php | 2 +- CRM/Core/PseudoConstant.php | 2 +- CRM/Profile/Form.php | 2 +- CRM/UF/Page/Group.php | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CRM/ACL/Form/ACL.php b/CRM/ACL/Form/ACL.php index 517a5c519f..c7ed0fb62b 100644 --- a/CRM/ACL/Form/ACL.php +++ b/CRM/ACL/Form/ACL.php @@ -170,7 +170,7 @@ class CRM_ACL_Form_ACL extends CRM_Admin_Form { $ufGroup = array('-1' => ts('- select -'), '0' => ts('All Profiles'), - ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFGroup', 'uf_group_id'); + ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id'); $event = array('-1' => ts('- select -'), '0' => ts('All Events'), diff --git a/CRM/ACL/Page/ACL.php b/CRM/ACL/Page/ACL.php index 6eb0838281..6e7931265f 100644 --- a/CRM/ACL/Page/ACL.php +++ b/CRM/ACL/Page/ACL.php @@ -180,7 +180,7 @@ ORDER BY entity_id ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_CustomField', 'custom_group_id'); $ufGroup = array('-1' => ts('- select -'), '0' => ts('All Profiles'), - ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFGroup', 'uf_group_id'); + ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id'); $event = array('-1' => ts('- select -'), '0' => ts('All Events'), diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index f998b898a2..05fed66b2d 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -220,7 +220,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { $fields = $subset; } else { - $ufGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFGroup', 'uf_group_id'); + $ufGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id'); $fields = array(); foreach ($ufGroups as $id => $title) { @@ -2445,7 +2445,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) */ static function getProfiles($types, $onlyPure = FALSE) { $profiles = array(); - $ufGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFGroup', 'uf_group_id'); + $ufGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id'); CRM_Utils_Hook::aclGroup(CRM_Core_Permission::ADMIN, NULL, 'civicrm_uf_group', $ufGroups, $ufGroups); @@ -2478,7 +2478,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) } $profiles = array(); - $ufGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFGroup', 'uf_group_id'); + $ufGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id'); CRM_Utils_Hook::aclGroup(CRM_Core_Permission::ADMIN, NULL, 'civicrm_uf_group', $ufGroups, $ufGroups); diff --git a/CRM/Core/Permission.php b/CRM/Core/Permission.php index 4b8aafbcd5..7ed3630011 100644 --- a/CRM/Core/Permission.php +++ b/CRM/Core/Permission.php @@ -209,7 +209,7 @@ class CRM_Core_Permission { } public static function ufGroup($type = CRM_Core_Permission::VIEW) { - $ufGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFGroup', 'uf_group_id'); + $ufGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id'); $allGroups = array_keys($ufGroups); diff --git a/CRM/Core/PseudoConstant.php b/CRM/Core/PseudoConstant.php index 3607893c02..736a2ee2be 100644 --- a/CRM/Core/PseudoConstant.php +++ b/CRM/Core/PseudoConstant.php @@ -486,7 +486,7 @@ class CRM_Core_PseudoConstant { * */ public static function flush($name = 'cache') { - if (property_exists(self, $name)) { + if (isset(self::$name)) { self::$$name = NULL; } } diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index 555651e01c..4adf3181eb 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -680,7 +680,7 @@ class CRM_Profile_Form extends CRM_Core_Form { CRM_Core_Permission::EDIT, NULL, 'civicrm_uf_group', - CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFGroup', 'uf_group_id') + CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id') ) ) ) { diff --git a/CRM/UF/Page/Group.php b/CRM/UF/Page/Group.php index 2c559e34ad..c04229689b 100644 --- a/CRM/UF/Page/Group.php +++ b/CRM/UF/Page/Group.php @@ -298,7 +298,7 @@ class CRM_UF_Page_Group extends CRM_Core_Page { return; } - $ufGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFGroup', 'uf_group_id'); + $ufGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id'); CRM_Utils_Hook::aclGroup(CRM_Core_Permission::ADMIN, NULL, 'civicrm_uf_group', $ufGroups, $allUFGroups); foreach ($allUFGroups as $id => $value) { -- 2.25.1