Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7.7
-
Component/s: CiviCRM API
-
Labels:
-
Versioning Impact:Major (incompatible API change)
-
Documentation Required?:Developer Doc
-
Funding Source:Contributed Code
Description
To reproduce: run the following.
CRM.api3('Group', 'create',
{ "title": "My Mailing List", "group_type": ["2"] });
CRM.api3('Group', 'getsingle',
{ "return": ["group_type"], "title": "My Mailing List" });
The result is:
{ "group_type": [ "0" ], "id": "9" }Note that the group_type is 0, not 2 as specified.
It turns out that the following format will successfully create the group with group_type 2:
CRM.api3('Group', 'create', {
"title": "My Mailing List",
"group_type":
});
However this parameter format is undocumented, cumbersome and AFAIK unnecessary. It is also different from the format given by the api "get" action.
The attached patch seems to fix this bug. Something like the following line of documentation would also help:
The group_type parameter should be an array of values from the "Group Type" Option Group.
Attachments
Issue Links
- links to