Skip to content

Commit

Permalink
#16 I think this is the missing fix on the multiple entity load
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Aug 11, 2014
1 parent 02d2cb1 commit 521a541
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions civicrm_entity_controller.inc
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ class CivicrmEntityController extends EntityAPIController {
foreach ($ids as $id) {
// we can't rely on civicrm api accepting the 'IN' => array(1,5,6) for all entities
$civicrm_entities = civicrm_api3($this->entityInfo['description'], 'get', array('id' => $id));
}
foreach ($civicrm_entities['values'] as $id => $civicrm_entity) {
// @TODO improve this casting.
$queried_entities[$id] = new CivicrmEntity($civicrm_entity, $this->entityType);
if ($civicrm_entities['count']) {
foreach ($civicrm_entities['values'] as $id => $civicrm_entity) {
// @TODO improve this casting.
$queried_entities[$id] = new CivicrmEntity($civicrm_entity, $this->entityType);

}
}
}
}
catch (Exception $e) {
Expand Down

0 comments on commit 521a541

Please sign in to comment.