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

When mycourses is included in hiddenuserfields the user cannot see his courses in his own profile page

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 1.9.5, 1.9.6, 1.9.7, 2.0
    • Administration, Usability
    • None
    • MOODLE_19_STABLE, MOODLE_20_STABLE
    • Easy

      When mycourses is included in hiddenuserfields the user cannot see his courses on his own profile page although, of course, the user can see his course list on the front page when he logins.

      We think that hiddenuserfields should not keep users from see/view their own details.

      That's why we have added a test ( $id == $USER->id ) in /user/view.php changing the lines

      /// Get the hidden field list
      if (has_capability('moodle/user:viewhiddendetails', $coursecontext)) {
      $hiddenfields = array();
      } else {
      $hiddenfields = array_flip(explode(',', $CFG->hiddenuserfields));
      }

      to the following

      /// Get the hidden field list
      if (has_capability('moodle/user:viewhiddendetails', $coursecontext) || $id == $USER->id) { <------- here is the change
      $hiddenfields = array();
      } else {
      $hiddenfields = array_flip(explode(',', $CFG->hiddenuserfields));
      }

            Unassigned Unassigned
            crmas Carlos Romero Mas (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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