diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-12-08 06:33:11 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-12-08 06:33:11 +0000 |
commit | ddf591963e2f1f3e8d10a230683ee180720469f2 (patch) | |
tree | 725e0b95915d4d6ce10b4544d56a55417ef7ccb4 /includes | |
parent | b2ee71c1ed236806d519e2525e237fa986d637c0 (diff) | |
download | brdo-ddf591963e2f1f3e8d10a230683ee180720469f2.tar.gz brdo-ddf591963e2f1f3e8d10a230683ee180720469f2.tar.bz2 |
#520740 by marcingy, catch, and Damien Tournoud: Fixed Comment threading (with test).
Diffstat (limited to 'includes')
-rw-r--r-- | includes/entity.inc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/includes/entity.inc b/includes/entity.inc index 06334ccee..5808bc662 100644 --- a/includes/entity.inc +++ b/includes/entity.inc @@ -100,7 +100,6 @@ class DrupalDefaultEntityController implements DrupalEntityControllerInterface { $this->revisionId = FALSE; } - // Create a new variable which is either a prepared version of the $ids // array for later comparison with the entity cache, or FALSE if no $ids // were passed. The $ids array is reduced as items are loaded from cache, @@ -141,16 +140,17 @@ class DrupalDefaultEntityController implements DrupalEntityControllerInterface { if (!empty($queried_entities) && !$this->revisionId) { $this->cacheSet($queried_entities); } - // Ensure that the returned array is ordered the same as the original - // $ids array if this was passed in and remove any invalid ids. - if ($passed_ids) { - // Remove any invalid ids from the array. - $passed_ids = array_intersect_key($passed_ids, $entities); - foreach ($entities as $entity) { - $passed_ids[$entity->{$this->idKey}] = $entity; - } - $entities = $passed_ids; + } + + // Ensure that the returned array is ordered the same as the original + // $ids array if this was passed in and remove any invalid ids. + if ($passed_ids) { + // Remove any invalid ids from the array. + $passed_ids = array_intersect_key($passed_ids, $entities); + foreach ($entities as $entity) { + $passed_ids[$entity->{$this->idKey}] = $entity; } + $entities = $passed_ids; } return $entities; |