Moodle

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

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9.5, 1.9.6, 1.9.7, 2.0
  • Fix Version/s: None
  • Component/s: Administration, Usability
  • Labels:
    None
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_19_STABLE, MOODLE_20_STABLE

Description

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));
}

Issue Links

Activity

Hide
Ann Adamcik added a comment -

This is an issue with other hidden fields (such as first/last access) as well. The problem still exists in more recent 1.9.x and 2.0 versions. We made the change above to allow users to see their own hidden fields.

Show
Ann Adamcik added a comment - This is an issue with other hidden fields (such as first/last access) as well. The problem still exists in more recent 1.9.x and 2.0 versions. We made the change above to allow users to see their own hidden fields.
Hide
Gilles-Philippe Leblanc added a comment - - edited

The problem is still unresolved in the version 2.0.3

Thanks for this tracker. We installed the patch in our production server.

Show
Gilles-Philippe Leblanc added a comment - - edited The problem is still unresolved in the version 2.0.3 Thanks for this tracker. We installed the patch in our production server.

People

Vote (2)
Watch (3)

Dates

  • Created:
    Updated: