From: atif-shaikh Date: Wed, 29 Oct 2014 08:24:52 +0000 (+0530) Subject: CRM-15427 Additional Fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f80ef0e2e0f4c37c6c0db723c50844f8894a12c2;p=civicrm-core.git CRM-15427 Additional Fixes ---------------------------------------- * CRM-15427: Profiles using Participants (Event type), Participants (Event Name) and Participants (Role) custom fields are not available for online registration https://issues.civicrm.org/jira/browse/CRM-15427 --- diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index 4e2662488e..14cb13cb23 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -1405,6 +1405,10 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { $params['limit_listings_group_id'] = CRM_Utils_Array::value('group', $params); $params['add_to_group_id'] = CRM_Utils_Array::value('add_contact_to_group', $params); + //CRM-15427 + if (!empty($params['group_type']) && is_array($params['group_type'])) { + $params['group_type'] = implode(',', $params['group_type']); + } $ufGroup = new CRM_Core_DAO_UFGroup(); $ufGroup->copyValues($params); diff --git a/CRM/Event/Form/ManageEvent/Registration.php b/CRM/Event/Form/ManageEvent/Registration.php index 040f42e098..4075c3c39d 100644 --- a/CRM/Event/Form/ManageEvent/Registration.php +++ b/CRM/Event/Form/ManageEvent/Registration.php @@ -380,12 +380,13 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent $configs['allowCoreTypes'][] = 'Individual'; $configs['allowCoreTypes'][] = 'Participant'; //CRM-15427 - $participantEventType = CRM_Core_DAO::getFieldValue("CRM_Event_DAO_Event", $_GET['id'], 'event_type_id', 'id'); - $participantRole = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $_GET['id'], 'default_role_id'); - $configs['allowSubTypes']['ParticipantEventName'] = array($_GET['id']); - $configs['allowSubTypes']['ParticipantEventType'] = array($participantEventType); - $configs['allowSubTypes']['ParticipantRole'] = array($participantRole); - + if (!empty($_GET['id']) && is_numeric($_GET['id'])) { + $participantEventType = CRM_Core_DAO::getFieldValue("CRM_Event_DAO_Event", $_GET['id'], 'event_type_id', 'id'); + $participantRole = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $_GET['id'], 'default_role_id'); + $configs['allowSubTypes']['ParticipantEventName'] = array($_GET['id']); + $configs['allowSubTypes']['ParticipantEventType'] = array($participantEventType); + $configs['allowSubTypes']['ParticipantRole'] = array($participantRole); + } $configs['profileEntities'][] = array('entity_name' => 'contact_1', 'entity_type' => 'IndividualModel'); $configs['profileEntities'][] = array('entity_name' => 'participant_1', 'entity_type' => 'ParticipantModel', 'entity_sub_type' => '*'); diff --git a/js/model/crm.uf.js b/js/model/crm.uf.js index 392d0a4414..b28f876140 100644 --- a/js/model/crm.uf.js +++ b/js/model/crm.uf.js @@ -666,8 +666,9 @@ * @return {Boolean} */ //CRM-15427 - checkGroupType: function(validTypesExpr, allowAllSubtypes = false) { + checkGroupType: function(validTypesExpr, allowAllSubtypes) { var allMatched = true; + allowAllSubtypes = allowAllSubtypes || false; if (! this.get('group_type') || this.get('group_type') == '') { return true; }