Permalink
Browse files

feature(groups): group owner transfer lists users alphabetically

When you wish to transfer the ownership of a large group it could be
hard to find the new owner as there was no sorting. Now users are listed
alphabetically.

We don’t create full ElggUser objects for improved performance.

Patch by @jeabakker
  • Loading branch information...
mrclay committed Jul 29, 2015
1 parent 15e69b8 commit a8bc79c262f1ec4c82c2d575c0d72b790c6c4635
Showing with 8 additions and 3 deletions.
  1. +8 −3 mod/groups/views/default/groups/edit/access.php
@@ -95,12 +95,17 @@
if ($entity && ($owner_guid == elgg_get_logged_in_user_guid() || elgg_is_admin_logged_in())) {
$members = array();
+ $dbprefix = elgg_get_config('dbprefix');
$options = array(
+ "type" => "user",
"relationship" => "member",
"relationship_guid" => $entity->getGUID(),
"inverse_relationship" => true,
- "type" => "user",
- "limit" => 0,
+ "limit" => false,
+ "callback" => false,
+ "joins" => ["JOIN {$dbprefix}users_entity ue ON e.guid = ue.guid"],
+ "selects" => ['ue.*'],
+ "order_by" => 'ue.name ASC',
);
$batch = new ElggBatch("elgg_get_entities_from_relationship", $options);
@@ -127,4 +132,4 @@
?>
</div>
<?php
-}
+}

0 comments on commit a8bc79c

Please sign in to comment.