You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a course is created with self-enrollment and the participant role does not have rolid = 5, or a different role has been configured for self-enrollment, then a user can enroll in the course, but no role is assigned.
In the file “moodle/admin/tool/supporter/classes/external.php” the roleid “5” is hard-coded
sorry for the late reply. To clarify the issue, we currently handle 2 cases after creating a new course:
If self-enrolment was automatically added to the course, we only set it to active, change roleid and password
$selfenrolment->status = 0; // 0 is active!
$selfenrolment->password = $selfenrolpassword; // The PW is saved as plain text.
$selfenrolment->roleid = 5; // Set the default role id for new users that enrol in the course.
$DB->update_record("enrol", $selfenrolment);
Otherwise, we manually add a new instance with roleid=5
Should the default self-enrol role be used instead of 5 only in the first case? If not, do you have an idea how we can get it if $selfenrolment is empty? Maybe something like get_config('enrol_self', 'roleid')?
Hi,
If a course is created with self-enrollment and the participant role does not have rolid = 5, or a different role has been configured for self-enrollment, then a user can enroll in the course, but no role is assigned.
In the file “moodle/admin/tool/supporter/classes/external.php” the roleid “5” is hard-coded
Here is a suggestion on how to change this.
Instead of the “5”, the default role from “Enrol” should be used.
Best regards,
Sybille
The text was updated successfully, but these errors were encountered: