Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7.12
-
Fix Version/s: 4.7.14
-
Component/s: None
-
Labels:
-
Documentation Required?:None
-
Funding Source:Contributed Code
Description
When using the UFGroup API to create a profile, say through an extension, we normally pass in a name parameter which helps us distinguish the profile we have created, even if the profile title is changed. The API currently does not take into account the value passed through the API, instead uses a function to build the name from the title, appending the profile ID with it.
For example:
If we use something like this:
$result = civicrm_api3('UFGroup', 'create', array(
'sequential' => 1,
'title' => "Test Profile",
'name' => "test_name",
));
One would expect a profile to be created with title = Test Profile, and name = test_name.
Currently, CiviCRM saves the profile as title = Test Profile and name = Test_Profile_14 where 14 is the profile ID.
This is particularly troublesome in extensions where profiles are being created using the managed hook entities since the ID isn't returned back by the function. Using the get API to retrieve the profile created via the title (label) is also error prone as this can be changed by the end user.