Moodle
  1. Moodle
  2. MDL-36395

Search for users has max of 100 results

    Details

    • Testing Instructions:
      Hide

      Prerequisite:

      1. Site with 10 users
      2. Log in as admin
      3. Update maxusersperpage to 2 (Site administration ► Users ► Permissions ► User policies)

      Test user selector in webservice

      1. Create external webservice (Site administration ► Plugins ► Web services ► External services) with "Authorised users only" checked.
      2. Click on "Authorised users" on external webservice page
      3. Make suer you see "Too many users to show" warning
      4. Change maxusersperpage to 100
      5. Go back to "Authorised users" page and make sure you see all users.

      Test manual enrolment (without JS)

      1. Go to course and go to enrolled users page (Course 1 ► Users ► Enrolled users)
      2. Click "Enrol users" and make sure you can see all users.
      3. Change maxusersperpage to 2 and you should see "Too many users to show" warning

      Test cohort

      1. Create cohort (Site administration ► Users ► Accounts ► Cohorts)
      2. Click "Assign" icon (Site administration ► Users ► Accounts ► Cohorts ► Assign)
      3. Make sure you see see "Too many users to show" warning
      4. Change maxusersperpage to 100
      5. Go back to "Assign" page and make sure you see all users.

      Test assigning system role

      1. Go to "Assign system role" (Site administration ► Users ► Permissions ► Assign system roles)
      2. Click "course creator"
      3. Make sure you can see all users.
      4. Change maxusersperpage to 2
      5. Go back to assign role page and you should see "Too many users to show" warning

      Test Groups

      1. Go to course and enrol 10 users.
      2. Click group (Course 1 ► Users ► Groups)
      3. Select group (if exists or create one) and click add/remove users (Course 1 ► Participants ► Groups ► Add/remove users)
      4. you should see "Too many users to show" warning
      5. Change maxusersperpage to 100
      6. Go back to add/remove users and you should see all users.

      Test forum

      1. Go to course forum and disable js
      2. Select Show/edit current subscribers
      3. You should be able to see all potential users
      4. Change maxusersperpage to 2
      5. Go back to Show/edit current subscribers page and you should see "Too many users to show" warning
      Show
      Prerequisite: Site with 10 users Log in as admin Update maxusersperpage to 2 (Site administration ► Users ► Permissions ► User policies) Test user selector in webservice Create external webservice (Site administration ► Plugins ► Web services ► External services) with "Authorised users only" checked. Click on "Authorised users" on external webservice page Make suer you see "Too many users to show" warning Change maxusersperpage to 100 Go back to "Authorised users" page and make sure you see all users. Test manual enrolment (without JS) Go to course and go to enrolled users page (Course 1 ► Users ► Enrolled users) Click "Enrol users" and make sure you can see all users. Change maxusersperpage to 2 and you should see "Too many users to show" warning Test cohort Create cohort (Site administration ► Users ► Accounts ► Cohorts) Click "Assign" icon (Site administration ► Users ► Accounts ► Cohorts ► Assign) Make sure you see see "Too many users to show" warning Change maxusersperpage to 100 Go back to "Assign" page and make sure you see all users. Test assigning system role Go to "Assign system role" (Site administration ► Users ► Permissions ► Assign system roles) Click "course creator" Make sure you can see all users. Change maxusersperpage to 2 Go back to assign role page and you should see "Too many users to show" warning Test Groups Go to course and enrol 10 users. Click group (Course 1 ► Users ► Groups) Select group (if exists or create one) and click add/remove users (Course 1 ► Participants ► Groups ► Add/remove users) you should see "Too many users to show" warning Change maxusersperpage to 100 Go back to add/remove users and you should see all users. Test forum Go to course forum and disable js Select Show/edit current subscribers You should be able to see all potential users Change maxusersperpage to 2 Go back to Show/edit current subscribers page and you should see "Too many users to show" warning
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull Master Branch:
      wip-mdl-36395-m
    • Rank:
      45212

      Description

      When you try to search for users to add them to a group or course, you often don't get a result. Instead, Moodle says 'too many search results'.

      I want to be able to see all the search results and add all the search results to a group or course.

        Issue Links

          Activity

          Hide
          Rajesh Taneja added a comment -

          Thanks for reporting this Richard.

          Adding more detail (replication steps) to your suggestion will make it easier to work on.

          If you can propose a code solution, that will help others who may have the same need and will increase the chance of this improvement/feature coming about sooner. If you are able to provide a patch or links to your Git repository branch, please add a patch label so we will spot it.

          Show
          Rajesh Taneja added a comment - Thanks for reporting this Richard. Adding more detail (replication steps) to your suggestion will make it easier to work on. If you can propose a code solution, that will help others who may have the same need and will increase the chance of this improvement/feature coming about sooner. If you are able to provide a patch or links to your Git repository branch, please add a patch label so we will spot it.
          Hide
          Richard van Iwaarden added a comment -

          Example 1:
          1. Go to a course
          2. Go to users -> groups
          3. Make a new group
          4. Add users to the group. If the search results typed right below exceeds 100 results, the users will not be displayed.

          Example 2:
          1. Go to a course
          2. Go to users -> Manual authentication
          3. Start adding users. If the search results exceeds 100 users, they will not be displayed.

          Example 3:
          1. Go to site admin -> users -> cohorts
          2. Add a cohort
          3. Add users to cohort. If the search results exceeds 100 users, they will not be displayed.

          When you run a big Moodle website like me you will also have groups, courses or cohorts with more than 100 people. You might search on cities, mailadresses, departments, etc. If the results are more than 100 users the results must be able to be displayed.

          I am not a programmer so I can not suggest a code to fix this. Other people have the same problem:
          https://moodle.org/mod/forum/discuss.php?d=198695
          https://moodle.org/mod/forum/discuss.php?d=175282
          https://moodle.org/mod/forum/discuss.php?d=186777

          Show
          Richard van Iwaarden added a comment - Example 1: 1. Go to a course 2. Go to users -> groups 3. Make a new group 4. Add users to the group. If the search results typed right below exceeds 100 results, the users will not be displayed. Example 2: 1. Go to a course 2. Go to users -> Manual authentication 3. Start adding users. If the search results exceeds 100 users, they will not be displayed. Example 3: 1. Go to site admin -> users -> cohorts 2. Add a cohort 3. Add users to cohort. If the search results exceeds 100 users, they will not be displayed. When you run a big Moodle website like me you will also have groups, courses or cohorts with more than 100 people. You might search on cities, mailadresses, departments, etc. If the results are more than 100 users the results must be able to be displayed. I am not a programmer so I can not suggest a code to fix this. Other people have the same problem: https://moodle.org/mod/forum/discuss.php?d=198695 https://moodle.org/mod/forum/discuss.php?d=175282 https://moodle.org/mod/forum/discuss.php?d=186777
          Hide
          Rajesh Taneja added a comment -

          Thanks Richard,

          I've put that on the backlog and we try to get this to this soon.

          Show
          Rajesh Taneja added a comment - Thanks Richard, I've put that on the backlog and we try to get this to this soon.
          Hide
          Tim Hunt added a comment -

          At the moment, the 100 limit is hard-coded as a constant in a few different subclasses on user_selector_base. (The base class is in user/selector/lib.php). We should fix the code so that either:

          1. the 100 limit is defined by a single constant in the user_selector_base class, and the same value is used everywhere; or

          2. make the limit an admin setting.

          Note that the limit should not allowed to be too big, for performance reasons.

          Show
          Tim Hunt added a comment - At the moment, the 100 limit is hard-coded as a constant in a few different subclasses on user_selector_base. (The base class is in user/selector/lib.php). We should fix the code so that either: 1. the 100 limit is defined by a single constant in the user_selector_base class, and the same value is used everywhere; or 2. make the limit an admin setting. Note that the limit should not allowed to be too big, for performance reasons.
          Hide
          Richard van Iwaarden added a comment - - edited

          Please note also that big Moodle websites are unmanageable if the limit stays at 100. I am at 5000+ users, the search results often exceed 100 users.

          For example: I wanted to create a group of our staff. Our staff all has a mail address that ends on @company.com. To create this group, I have typed 26 times a@company.com, b@company.com, c@company.com etc. Even then, I had to find certain members with en@company.com

          There's no other way in Moodle to create a course, group or cohort with members.

          Show
          Richard van Iwaarden added a comment - - edited Please note also that big Moodle websites are unmanageable if the limit stays at 100. I am at 5000+ users, the search results often exceed 100 users. For example: I wanted to create a group of our staff. Our staff all has a mail address that ends on @company.com. To create this group, I have typed 26 times a@company.com, b@company.com, c@company.com etc. Even then, I had to find certain members with en@company.com There's no other way in Moodle to create a course, group or cohort with members.
          Hide
          Richard Price added a comment - - edited

          We have 3000+ users on our Moodle, and to bulk enrol Teachers, AllStaff, Pupils, Parents we use syncronised cohorts.

          But, we also use front page Groups, tried the create from cohort method creates a group from that but does not seem to sync to that cohort, but instead seems to be a snapshot created from that cohort. Without this search working, adding new intake students requires recreating from that synchronised cohort as searching for (Pupil) once a new year has started means that there are more than 100 to add. 26 Searches of a(Pupil), b(Pupil... etc... and is not efficient use of my time.

          If I need to find and add a member of staff or student with a common surname but cannot remember the initial, parents+students+staff with that surname can easily top that 100 limit and means that the search where you cannot quite remember some details means I have to look up in another system before searching within moodle. More time wasted. If it was an admin setting, It would be a quick change to change for usability (for many of us) or performance (those with all automation) and not need a code change.

          Show
          Richard Price added a comment - - edited We have 3000+ users on our Moodle, and to bulk enrol Teachers, AllStaff, Pupils, Parents we use syncronised cohorts. But, we also use front page Groups, tried the create from cohort method creates a group from that but does not seem to sync to that cohort, but instead seems to be a snapshot created from that cohort. Without this search working, adding new intake students requires recreating from that synchronised cohort as searching for (Pupil) once a new year has started means that there are more than 100 to add. 26 Searches of a(Pupil), b(Pupil... etc... and is not efficient use of my time. If I need to find and add a member of staff or student with a common surname but cannot remember the initial, parents+students+staff with that surname can easily top that 100 limit and means that the search where you cannot quite remember some details means I have to look up in another system before searching within moodle. More time wasted. If it was an admin setting, It would be a quick change to change for usability (for many of us) or performance (those with all automation) and not need a code change.
          Hide
          Richard van Iwaarden added a comment -

          Richard, please change your first name. I heard Martin Dougiamas was searching me on Moodle and couldn't find me because you and another 98 Richard's registered on the Moodle site.

          So please change your first name to something else on behalf of the 98 other people called Richard. Thank you

          Show
          Richard van Iwaarden added a comment - Richard, please change your first name. I heard Martin Dougiamas was searching me on Moodle and couldn't find me because you and another 98 Richard's registered on the Moodle site. So please change your first name to something else on behalf of the 98 other people called Richard. Thank you
          Hide
          Andreas Stoeffer added a comment -

          Here is the workaround:

          Change in webroot/moodle/admin/roles/lib.php on line 988 : const MAX_USERS_PER_PAGE = 100
          It is the only change and it works for me.

          Show
          Andreas Stoeffer added a comment - Here is the workaround: Change in webroot/moodle/admin/roles/lib.php on line 988 : const MAX_USERS_PER_PAGE = 100 It is the only change and it works for me.
          Hide
          Richard van Iwaarden added a comment -

          To bad we're not in the position to do that, we have a hosted Moodle. We can't edit core code whenever we feel like it.

          Show
          Richard van Iwaarden added a comment - To bad we're not in the position to do that, we have a hosted Moodle. We can't edit core code whenever we feel like it.
          Hide
          Ray Morris added a comment - - edited

          +1 to Tim's comment. Regardless of your opinion about the limit, having the same constant defined in different places, and possibly with different names, is objectively incorrect™. It should be a setting, or a single constant. ONE setting if it has the same meaning in various places, possibly two settings if the same constant is used for two distinctly different things which logically might be set differently.

          Should the user selector have pair of drop downs like so?:

          Select all users in:

          *Course
          *Group
          *Role
          *Cohort

          *Moodle 101
          *GUI design 201
          *Intro to Web Interfaces

          Show
          Ray Morris added a comment - - edited +1 to Tim's comment. Regardless of your opinion about the limit, having the same constant defined in different places, and possibly with different names, is objectively incorrect™. It should be a setting, or a single constant. ONE setting if it has the same meaning in various places, possibly two settings if the same constant is used for two distinctly different things which logically might be set differently. Should the user selector have pair of drop downs like so?: Select all users in: *Course *Group *Role *Cohort *Moodle 101 *GUI design 201 *Intro to Web Interfaces
          Hide
          Rajesh Taneja added a comment -

          Adding this to next sprint.

          Show
          Rajesh Taneja added a comment - Adding this to next sprint.
          Hide
          Tim Hunt added a comment -

          Raj, what are you proposing to do to this during the next sprint?

          Show
          Tim Hunt added a comment - Raj, what are you proposing to do to this during the next sprint?
          Hide
          Rajesh Taneja added a comment -

          Hello Tim,

          I will probably go with your suggestion.
          Making it configurable will probably help admin get around this problem. (MAX_ITEMS_FOR_SELECTION / MAX_USERS_IN_LIST)

          Show
          Rajesh Taneja added a comment - Hello Tim, I will probably go with your suggestion. Making it configurable will probably help admin get around this problem. (MAX_ITEMS_FOR_SELECTION / MAX_USERS_IN_LIST)
          Hide
          Richard van Iwaarden added a comment -

          Yes please, let me be able to select the max number of users myself.

          @Ray, dropdown menu is thinking big? Our Moodle has over 900 cohorts. Try selecting the correct value from a dropdownmenu! Same goes for the dropdownmenu in metacourse selection, who's idea was that? Try using it with 4000+ courses.

          Show
          Richard van Iwaarden added a comment - Yes please, let me be able to select the max number of users myself. @Ray, dropdown menu is thinking big? Our Moodle has over 900 cohorts. Try selecting the correct value from a dropdownmenu! Same goes for the dropdownmenu in metacourse selection, who's idea was that? Try using it with 4000+ courses.
          Hide
          Ray Morris added a comment -

          @Richard, agreed. The first drop down to choose between course, group, chohort and role would work. Then you'd need a different UI element to choose WHICH course/chort/etc. though.

          Show
          Ray Morris added a comment - @Richard, agreed. The first drop down to choose between course, group, chohort and role would work. Then you'd need a different UI element to choose WHICH course/chort/etc. though.
          Hide
          Rajesh Taneja added a comment -

          Hello Everyone,

          I have been looking at this and it seems rather then having configuration,
          it will be nice to add two links next to search message ("Please use search or Show all/100 more").

          As all these are extended from user_selector_base, it might be nice if user_selector_base keep number of users to display.

          FYI: With so many configurations in moodle, IMHO we should be looking at alternatives first.

          Show
          Rajesh Taneja added a comment - Hello Everyone, I have been looking at this and it seems rather then having configuration, it will be nice to add two links next to search message ("Please use search or Show all/100 more "). As all these are extended from user_selector_base, it might be nice if user_selector_base keep number of users to display. FYI: With so many configurations in moodle, IMHO we should be looking at alternatives first.
          Hide
          Michael de Raadt added a comment -

          Shifting to the next sprint.

          Show
          Michael de Raadt added a comment - Shifting to the next sprint.
          Hide
          Rajesh Taneja added a comment -

          We need to come up with some decision on which way to go.
          Should we add config variable or add another link next to search message for expanding list?

          Show
          Rajesh Taneja added a comment - We need to come up with some decision on which way to go. Should we add config variable or add another link next to search message for expanding list?
          Hide
          Johannes Albert added a comment -

          +1 for $CFG solution. Many higher ed institutions have privacy policies in place, which enforce strict limitations on the number of records exposed in an LMS's user lists, to prevent "rogue" trainers from easily scraping the DB. Right now, making Moodle adhere to these policies is tedious and error-prone...

          Show
          Johannes Albert added a comment - +1 for $CFG solution. Many higher ed institutions have privacy policies in place, which enforce strict limitations on the number of records exposed in an LMS's user lists, to prevent "rogue" trainers from easily scraping the DB. Right now, making Moodle adhere to these policies is tedious and error-prone...
          Hide
          Howard Miller added a comment - - edited

          Just to note that for those old enough to remember this was set to 5000 in 1.9. That's quite a change. The default value is far too low.

          It also affects the groups select page in that the list of potential users is too few. It makes it very hard to select blocks of users for even moderately sized courses.

          Show
          Howard Miller added a comment - - edited Just to note that for those old enough to remember this was set to 5000 in 1.9. That's quite a change. The default value is far too low. It also affects the groups select page in that the list of potential users is too few. It makes it very hard to select blocks of users for even moderately sized courses.
          Hide
          Rajesh Taneja added a comment -

          As suggested, hard-coded const is converted to config setting.

          I am not sure if forum should also respect this. IMO yes it should.

          Show
          Rajesh Taneja added a comment - As suggested, hard-coded const is converted to config setting. I am not sure if forum should also respect this. IMO yes it should.
          Hide
          Tim Hunt added a comment -

          Yes, forum should respect this.

          [N] Sanity check

          1. admin/settings/subsystems.php is a terrible place to have this setting. I think a logical place would be near the setting "Show user identity" on User -> Permissions -> User policies.

          2. Did you consider other options beside a text box? It could be a drop-down with 50 / 100 / 500 / 1000 / 5000. (Bigger than that might start to cause usability problems. It would make the testing instructions harder to write.)

          [N] Testing

          1. Will need to be updated once sanity is restored

          [N] Git

          1. This should be squashed to one commit.
          2. The first line of each commit comment is way too long. (You need to avoid the ... in the github interface.)

          [Y] Documentation - docs_required label is specified.
          [Y] Syntax
          [Y] Output
          [Y] Whitespace
          [Y] Language
          [-] Databases
          [-] Security

          Show
          Tim Hunt added a comment - Yes, forum should respect this. [N] Sanity check 1. admin/settings/subsystems.php is a terrible place to have this setting. I think a logical place would be near the setting "Show user identity" on User -> Permissions -> User policies. 2. Did you consider other options beside a text box? It could be a drop-down with 50 / 100 / 500 / 1000 / 5000. (Bigger than that might start to cause usability problems. It would make the testing instructions harder to write.) [N] Testing 1. Will need to be updated once sanity is restored [N] Git 1. This should be squashed to one commit. 2. The first line of each commit comment is way too long. (You need to avoid the ... in the github interface.) [Y] Documentation - docs_required label is specified. [Y] Syntax [Y] Output [Y] Whitespace [Y] Language [-] Databases [-] Security
          Hide
          Rajesh Taneja added a comment -

          Thanks for the review Tim,

          1. Have moved config setting next to "Show user identity"
          2. Yes, I thought of drop-down. IMHO it should be text field to keep it more flexible.
          3. Updated testing instruction
          4. Merged commits and reword commit msg.

          Hope this is fine now.
          It will be nice if you can give it another glance, before I push this for integration.

          Show
          Rajesh Taneja added a comment - Thanks for the review Tim, Have moved config setting next to "Show user identity" Yes, I thought of drop-down. IMHO it should be text field to keep it more flexible. Updated testing instruction Merged commits and reword commit msg. Hope this is fine now. It will be nice if you can give it another glance, before I push this for integration.
          Hide
          Tim Hunt added a comment -

          +1 from me now.

          I forgot to say before, I love a patch that reduces the size of the codebase ("with 21 additions and 23 deletions.").

          I'll let you click the Integration button.

          Show
          Tim Hunt added a comment - +1 from me now. I forgot to say before, I love a patch that reduces the size of the codebase ("with 21 additions and 23 deletions."). I'll let you click the Integration button.
          Hide
          Rajesh Taneja added a comment -

          Thanks Tim,

          You made my day

          Show
          Rajesh Taneja added a comment - Thanks Tim, You made my day
          Hide
          Rajesh Taneja added a comment -

          Hello Tim,

          I was looking at this again and it seems rather then making this a site config, can we add this to config-dist ?

          I have added another commit as proof-of-concept, will merge and update test instructions after your feedback.

          Show
          Rajesh Taneja added a comment - Hello Tim, I was looking at this again and it seems rather then making this a site config, can we add this to config-dist ? I have added another commit as proof-of-concept, will merge and update test instructions after your feedback.
          Hide
          Tim Hunt added a comment -

          You just want to make the code longer again

          No, don't add it to config-dist.php. We only add things to config-dist.php when they are not visible in the admin UI. If somethings can be set in the admin UI, then users can learn about it that way (and can fix it in config-dist if they really want.)

          Show
          Tim Hunt added a comment - You just want to make the code longer again No, don't add it to config-dist.php. We only add things to config-dist.php when they are not visible in the admin UI. If somethings can be set in the admin UI, then users can learn about it that way (and can fix it in config-dist if they really want.)
          Hide
          Rajesh Taneja added a comment -

          Thanks Tim,

          Other commit removes it from admin UI and just moves it to config-dist.
          As this is only an issue with big sites, it might not be required on admin UI.

          Anyways will remove other commit.

          Thanks for all the guidance.

          Show
          Rajesh Taneja added a comment - Thanks Tim, Other commit removes it from admin UI and just moves it to config-dist. As this is only an issue with big sites, it might not be required on admin UI. Anyways will remove other commit. Thanks for all the guidance.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Damyon Wiese added a comment -

          This change looks good to me (and looks useful).

          Thanks Raj and Tim.

          Integrated to master.

          Show
          Damyon Wiese added a comment - This change looks good to me (and looks useful). Thanks Raj and Tim. Integrated to master.
          Hide
          Adrian Greeve added a comment -

          Tested on the master integration branch.
          Thanks Raj for the great testing instructions.
          Test passed.

          Show
          Adrian Greeve added a comment - Tested on the master integration branch. Thanks Raj for the great testing instructions. Test passed.
          Hide
          Damyon Wiese added a comment -

          This issue has been integrated upstream and is now available via git (and in some hours, via mirrors and downloads).

          Thanks for your contributions!

          Show
          Damyon Wiese added a comment - This issue has been integrated upstream and is now available via git (and in some hours, via mirrors and downloads). Thanks for your contributions!
          Hide
          Mary Cooch added a comment -

          Removing docs_required label as this is documented now in http://docs.moodle.org/25/en/User_policies

          Show
          Mary Cooch added a comment - Removing docs_required label as this is documented now in http://docs.moodle.org/25/en/User_policies

            People

            • Votes:
              14 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: