Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Won't Fix
-
Affects Version/s: 4.4.3
-
Fix Version/s: Unscheduled
-
Component/s: CiviCRM API
-
Labels:None
-
Documentation Required?:None
-
Funding Source:Needs Funding
Description
The get action of the ActivityType entity only returns the names of the ActivityTypes
however in Activity types are referred to by activity_type_id, these are not returned by get
so its results are of limited use.
It should return the name and corresponding activity_type_id
In my code I want to see if an ActivityType already exists and if it does use its activity_type_id in creating an activity. The first is possible the second is not.
civicrm/api/v3/ActivityType.php uses the CRM_Core_OptionGroup::values function.
function civicrm_api3_activity_type_get($params) {
$activityTypes = CRM_Core_OptionGroup::values('activity_type');
This is problematic as the function itself notes:
- This function retrieves all the values for the specific option group by name
- this is primarily used to create various html based form elements
this doesn't seem a likely use case for the API, certainly not the REST API.