From 0056e5cfe5c588907b1d7e2b7c050176bb5e3afa Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 17 Feb 2010 14:55:56 +0000 Subject: Fixes #1499: User and group search default to ignoring subtypes to return all entities. git-svn-id: http://code.elgg.org/elgg/trunk@3942 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/search/search_hooks.php | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'mod/search/search_hooks.php') diff --git a/mod/search/search_hooks.php b/mod/search/search_hooks.php index 8dcaa76ea..1c109025a 100644 --- a/mod/search/search_hooks.php +++ b/mod/search/search_hooks.php @@ -81,6 +81,9 @@ function search_groups_hook($hook, $type, $value, $params) { )"; $params['wheres'] = array($where); + // override subtype -- All groups should be returned regardless of subtype. + $params['subtype'] = NULL; + $entities = elgg_get_entities($params); $params['count'] = TRUE; $count = elgg_get_entities($params); @@ -129,6 +132,9 @@ function search_users_hook($hook, $type, $value, $params) { )"; $params['wheres'] = array($where); + // override subtype -- All users should be returned regardless of subtype. + $params['subtype'] = NULL; + $entities = elgg_get_entities($params); $params['count'] = TRUE; $count = elgg_get_entities($params); @@ -190,24 +196,6 @@ function search_tags_hook($hook, $type, $value, $params) { $search_tag_names = $valid_tag_names; } -// $name_value_pairs = array(); -// foreach ($search_tag_names as $tag_name) { -// $name_value_pairs[] = array ( -// 'name' => $tag_name, -// 'value' => $query, -// 'case_sensitive' => FALSE -// ); -// } -// -// $params['metadata_name_value_pairs'] = $name_value_pairs; -// $params['metadata_name_value_pairs_operator'] = 'OR'; -// -// $params = array(); -// -// $entities = elgg_get_entities_from_metadata($params); -// $params['count'] = TRUE; -// $count = elgg_get_entities_from_metadata($params); - // don't use elgg_get_entities_from_metadata() here because of // performance issues. since we don't care what matches at this point // use an IN clause to grab everything that matches at once and sort -- cgit v1.2.3