MDL-17143 Avoid notices caused by not existing profilesforenrolledusersonly setting
This commit is contained in:
+1
-1
@@ -62,7 +62,7 @@ class user_edit_form extends moodleform {
|
||||
}
|
||||
|
||||
// remove description
|
||||
if (!get_record('role_assignments', 'userid', $userid) && empty($user->description) && $CFG->profilesforenrolledusersonly) {
|
||||
if (!get_record('role_assignments', 'userid', $userid) && empty($user->description) && !empty($CFG->profilesforenrolledusersonly)) {
|
||||
$mform->removeElement('description');
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ class user_editadvanced_form extends moodleform {
|
||||
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
$can_edit_user = has_capability('moodle/user:update', $sitecontext);
|
||||
// remove description
|
||||
if (!get_record('role_assignments', 'userid', $userid) && empty($user->description) && $CFG->profilesforenrolledusersonly && !$can_edit_user) {
|
||||
if (!get_record('role_assignments', 'userid', $userid) && empty($user->description) && !empty($CFG->profilesforenrolledusersonly) && !$can_edit_user) {
|
||||
$mform->removeElement('description');
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -222,7 +222,7 @@
|
||||
if ($user->description && !isset($hiddenfields['description'])) {
|
||||
$has_courseid = ($course->id != SITEID);
|
||||
if (!get_record('role_assignments', 'userid', $id)
|
||||
&& !$has_courseid && $CFG->profilesforenrolledusersonly) {
|
||||
&& !$has_courseid && !empty($CFG->profilesforenrolledusersonly)) {
|
||||
echo get_string('profilenotshown', 'moodle').'<hr />';
|
||||
} else {
|
||||
echo format_text($user->description, FORMAT_MOODLE)."<hr />";
|
||||
@@ -331,6 +331,7 @@
|
||||
/// Print the Custom User Fields
|
||||
profile_display_fields($user->id);
|
||||
|
||||
require_once($CFG->dirroot . '/blocks/extrafields/user_view.php');
|
||||
|
||||
if ($mycourses = get_my_courses($user->id, null, null, false, 21)) {
|
||||
$shown=0;
|
||||
|
||||
Reference in New Issue
Block a user