]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #1499: User and group search default to ignoring subtypes to return all entities.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 17 Feb 2010 14:55:56 +0000 (14:55 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 17 Feb 2010 14:55:56 +0000 (14:55 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@3942 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/search/search_hooks.php

index 8dcaa76eaf690e660b390e79d9904770d26122b7..1c109025ae3b17ddd82f5428f43fc91558aa9dcc 100644 (file)
@@ -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