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

get_role_users() does not recognise "u.*" and "u.fieldname AS fieldalias" in the fields list (regression from MDL-52574)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1, 3.1 regressions
    • Fix Version/s: 3.1.2
    • Component/s: Libraries
    • Labels:
    • Testing Instructions:
      Hide

      Run the PHPUnit tests in lib/tests/accesslib_test.php. From the Moodle root directory:

      php vendor/bin/phpunit core_accesslib_testcase lib/tests/accesslib_test.php
      

      Change the user as appropriate to your installation.

      Show
      Run the PHPUnit tests in lib/tests/accesslib_test.php. From the Moodle root directory: php vendor/bin/phpunit core_accesslib_testcase lib/tests/accesslib_test.php Change the user as appropriate to your installation.
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull Master Branch:
      MDL_55423_master

      Description

      Things that were broken by the new code added there:

      • Passing $fields = 'u.*'. You get debugging like 'Debugging: get_role_users() adding u.lastname, u.firstname, u.id to the query result because they were required by $sort but missing in $fields'
      • Passing $fields = 'u.id AS some_alias'.

      I am also pretty sure that the call to get_role_users in grade/report/singleview/classes/local/screen/select.php is likely to trigger the new debugging, and needs to be fixed.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              alexandru.elisei Alexandru Elisei
              Reporter:
              timhunt Tim Hunt
              Peer reviewer:
              Tim Hunt
              Integrator:
              Dan Poltawski
              Tester:
              Mark Nelson
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/Sep/16