Skip to content

Commit

Permalink
fixed: inviting all site members crashed the invite action
Browse files Browse the repository at this point in the history
  • Loading branch information
jeabakker committed May 26, 2020
1 parent 54e285d commit 5cebd28
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions actions/groups/invite.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@
$adding = false;
if (elgg_is_admin_logged_in()) {
// add all users?
if (get_input('all_users') == 'yes') {
$site = elgg_get_site_entity();
if (get_input('all_users') === 'yes') {
// this could take a while
set_time_limit(0);

$options = [
// prepare a batch for memory saving
$user_guids = elgg_get_entities([
'type' => 'user',
'limit' => false,
'callback' => function ($row) {
return (int) $row->guid;
},
];

$user_guids = $site->getMembers($options);
'batch' => true,
]);
}

// add users directly?
Expand All @@ -44,7 +46,7 @@
$csv = elgg_get_uploaded_file('csv');

$resend = false;
if (get_input('resend') == 'yes') {
if (get_input('resend') === 'yes') {
$resend = true;
}

Expand Down

0 comments on commit 5cebd28

Please sign in to comment.