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

Make role entity name column more predictably sorted

XMLWordPrintable

    • MOODLE_403_STABLE
    • MOODLE_403_STABLE
    • MDL-79962-403
    • Hide
      1. Log in as admin
      2. Navigate to Users > Permissions > Define roles in site administration
      3. Press Add a new role
      4. Select Manager archetype
        • Short name: elephant
        • Custom full name: elephant
      5. Create a new user
      6. Navigate to Courses > Manage courses and categories in site administration
      7. Press the Actions menu for Category 1 and select Permissions
      8. Select Assign roles from navigation
      9. Assign test user to each role (Manager, Course creator, elephant)
      10. Navigate to Reports from user menu
      11. Create report from Course categories report source
        • Include default setup: No
      12. Add following columns:
        • Course category > Category name
        • Role > Role name
        • User > Full name
      13. Open Sorting panel in editor
      14. Enable sorting for Role name column
      15. Confirm sorting of rows goes:
        • Course creator
        • elephant
        • Manager
      16. Press Sort column 'Role name' descending
      17. Confirm the role column is now sorted descending alphabetically
      Show
      Log in as admin Navigate to Users > Permissions > Define roles in site administration Press Add a new role Select Manager archetype Short name: elephant Custom full name: elephant Create a new user Navigate to Courses > Manage courses and categories in site administration Press the Actions menu for Category 1 and select Permissions Select Assign roles from navigation Assign test user to each role (Manager, Course creator, elephant) Navigate to Reports from user menu Create report from Course categories report source Include default setup: No Add following columns: Course category > Category name Role > Role name User > Full name Open Sorting panel in editor Enable sorting for Role name column Confirm sorting of rows goes: Course creator elephant Manager Press Sort column 'Role name' descending Confirm the role column is now sorted descending alphabetically

      See this code: https://github.com/moodle/moodle/blob/859df15e73a331198adc43f957ab5e033b3c26ca/admin/roles/classes/reportbuilder/local/entities/role.php#L98

      The role.name column is empty for all default/pre-defined roles, because they are defined by language strings

      This means that trying to sort by this column causes undefined/inconsistent behaviour - fix that by making it deterministic (useful to avoid random failures in tests such as WP-4468)

            pholden Paul Holden
            pholden Paul Holden
            David Carrillo David Carrillo
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 54 minutes
                1h 54m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.