Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-11111

The number of search results is not always correct in the role assignment view

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.8.3, 1.9
    • Component/s: Roles / Access
    • Labels:
      None
    • Database:
      Any
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      If you have two "Samulis" in the system, and one in the selected role, then searching for "Samuli" will show "Search results (2)" but only one "Samuli" on the list.

      The problem code is in /admin/roles/assign.php and assign.html. It counts the number of search hits before subtracting the $contextusers that are already in the context.

      The problem is more in-your-face if all of the search results are alredy in the context. You get a non-zero amount of search results, but an empty list nevertheless.

      One possible solution: use the get_users() instead, and construct the exceptions-list for the function call, based on $contextusers.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lazyfish Yu Zhang
              Reporter:
              samulik Samuli Karevaara
              Tester:
              Nobody
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Oct/07