Details
-
Type:
Bug
-
Status: Done/Fixed
-
Priority:
Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.6, 4.7
-
Fix Version/s: 4.7
-
Component/s: CiviCRM API
-
Labels:
-
Documentation Required?:None
-
Funding Source:Contributed Code
Description
When fetching the custom value(s) of an entity and specifying the entity table , the retunr structure is incorrect, which makes it also difficult to loop over the result.
Reproducable example on the demo site:
// Set a custom value of participant 47
$result = civicrm_api3('CustomValue', 'create', array(
'entity_id' => 47,
'custom_4' => "bean",
'entity_table' => "civicrm_participant",
));
// get all the custom values of participant 47
$result = civicrm_api3('CustomValue', 'get', array(
'sequential' => 1,
'entity_id' => 47,
'entity_table' => "civicrm_participant",
));
current result :
{
"is_error":0,
"version":3,
"count":2,
"values":[{
"entity_id":"47",
"latest":"bean",
"id":"4",
"0":"bean"
},
{
"entity_table":"Participant"
}]
}
expected result
{
"is_error":0,
"version":3,
"count":1,
"values":[{
"entity_id":"47",
"latest":"bean",
"id":"4",
"0":"bean"
"entity_table":"Participant"
}]
}