}
}
$options = _civicrm_api3_get_options_from_params($params);
- $returnFields = !empty($options['return']) ? $options['return'] : array('id');
+ $returnFields = !empty($options['return']) ? $options['return'] : array();
+ if (!in_array('id', $returnFields)) {
+ $returnFields = array_merge($returnFields, array('id'));
+ }
return _civicrm_api3_basic_array_get('Extension', $params, $result, 'id', $returnFields);
}
* Test that extension get can be filtered by id.
*/
public function testGetExtensionByID() {
- $result = $this->callAPISuccess('extension', 'get', array('id' => 2));
+ $result = $this->callAPISuccess('extension', 'get', array('id' => 2, 'return' => array('label')));
$this->assertEquals(1, $result['count']);
}