aboutsummaryrefslogtreecommitdiff
path: root/mod/search/search_hooks.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-02-17 14:55:56 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-02-17 14:55:56 +0000
commit0056e5cfe5c588907b1d7e2b7c050176bb5e3afa (patch)
tree7af59d768fecd5412a4ac8675e6795e4a5b73fce /mod/search/search_hooks.php
parent0f22e81375a552c63e3b8d533545505a57e06099 (diff)
downloadelgg-0056e5cfe5c588907b1d7e2b7c050176bb5e3afa.tar.gz
elgg-0056e5cfe5c588907b1d7e2b7c050176bb5e3afa.tar.bz2
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
Diffstat (limited to 'mod/search/search_hooks.php')
-rw-r--r--mod/search/search_hooks.php24
1 files changed, 6 insertions, 18 deletions
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