Skip to content

Commit

Permalink
Merge pull request #1421 from creative-commoners/pulls/2.1/limit-100
Browse files Browse the repository at this point in the history
FIX Limit Member map to 100
  • Loading branch information
GuySartorelli authored Nov 8, 2023
2 parents 634beab + a50f9e4 commit fa5a5e5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion code/Forms/AssetFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,16 @@ protected function getFormFieldSecurityTab($record, $context = [])
// No "Anyone" editors option
$editorsOptionsField = $viewersOptionsField;
unset($editorsOptionsField[InheritedPermissions::ANYONE]);
$membersMap = Member::get()->map('ID', 'Name');

// $membersMap is limited to 100 records specifically so that it does not crash the front-end
// if the website has a large number of Members, which is likely to happen if the website also
// uses the Member table for non-cms public users
// This limit should be removed if the ListboxField front-end component is switched out or
// modified so that it does not load all users at once and instead uses XHR to fetch a subset
// of users based on what the user types in
$membersMap = Member::get()
->limit(100)
->map('ID', 'Name');

return Tab::create(
'Permissions',
Expand Down

0 comments on commit fa5a5e5

Please sign in to comment.