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

For user without capability viewfullnames the user name column in RB may be incorrect

XMLWordPrintable

    • MOODLE_403_STABLE
    • MOODLE_402_STABLE, MOODLE_403_STABLE
    • MDL-80564-403
    • Hide
      1. Log in as admin
      2. Create a new user
      3. Make sure the regular user ("Authenticated user" role) does not have capability 'moodle/site:viewfullnames' - this should be default
      4. Navigate to Users > Permissions > User policies in site administration
      5. Set Alternative full name format to 'firstname'
      6. Navigate to Reports from user menu
      7. Create a new report from the 'Users' report source
        • Include default setup: Yes
      8. In report editor, press Audience tab
      9. Add All users audience and save changes
      10. View the report as admin, make sure you only see first names
      11. Log out
      12. Log in as test user
      13. Navigate to Reports from user menu
      14. View the report as the regular user, make sure you see first and last name
      Show
      Log in as admin Create a new user Make sure the regular user ("Authenticated user" role) does not have capability 'moodle/site:viewfullnames' - this should be default Navigate to Users > Permissions > User policies in site administration Set Alternative full name format to 'firstname' Navigate to Reports from user menu Create a new report from the 'Users' report source Include default setup: Yes In report editor, press Audience tab Add All users audience and save changes View the report as admin, make sure you only see first names Log out Log in as test user Navigate to Reports from user menu View the report as the regular user, make sure you see first and last name
    • WP Sprint 2024-I1.0 (Atlantic)

      While working on MDL-80548 I found a minor bug that I thought would be nice to fix.

      In the function get_all_columns() in the classes/local/entities/user.php we get the list of the fields for the name columns passing $override=true
      but when we call the fullname() function on the result, we pass it with the $override=has_capability('moodle/site:viewfullnames')

      See lines 163, 190 and 375:
      https://github.com/moodle/moodle/blob/v4.3.2/reportbuilder/classes/local/entities/user.php#L163-L190
      and
      https://github.com/moodle/moodle/blob/v4.3.2/reportbuilder/classes/local/entities/user.php#L375

      This means that in some edge cases (I must admin, very unlikely), when 'alternativefullnameformat' contains LESS fields that 'fullnamedisplay', we will not get them in the results.

      Also the sorting may be off in the scenario like this:

      • fullnamedisplay='firstname lastname'
      • alternativefullnameformat='lastname, firstname middlename'

            marina Marina Glancy
            marina Marina Glancy
            David Carrillo David Carrillo
            Paul Holden Paul Holden
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 25 minutes
                2h 25m

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