From 1d32fd2b562ba61f4a5a6b253812d0489513b9d5 Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 26 May 2010 16:45:32 +0000 Subject: Fix problem rewriting type_subtype_pair -> type_subtype_pairs in elgg_get_entities(). git-svn-id: http://code.elgg.org/elgg/trunk@6238 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/entities.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/engine/lib/entities.php b/engine/lib/entities.php index a18e1c612..3b3830948 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -1808,10 +1808,18 @@ function elgg_get_entities(array $options = array()) { 'joins' => array() ); - $options = array_merge($defaults, $options); - $singulars = array('type', 'subtype', 'owner_guid', 'container_guid', 'site_guid', 'type_subtype_pair'); + // can't use helper function with type_subtype_pair because it's already an array...just need to merge it + if (isset($options['type_subtype_pair'])) { + if (isset($options['type_subtype_pairs'])) { + $options['type_subtype_pairs'] = array_merge($options['type_subtype_pairs'], $options['type_subtype_pair']); + } else { + $options['type_subtype_pairs'] = $options['type_subtype_pair']; + } + } + + $singulars = array('type', 'subtype', 'owner_guid', 'container_guid', 'site_guid'); $options = elgg_normalise_plural_options_array($options, $singulars); // evaluate where clauses -- cgit v1.2.3