Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

403_stable: error enroling user to a course #1970

Open
sibjac opened this issue Apr 21, 2024 · 9 comments
Open

403_stable: error enroling user to a course #1970

sibjac opened this issue Apr 21, 2024 · 9 comments

Comments

@sibjac
Copy link

sibjac commented Apr 21, 2024

I am getting below error when enrolling a user to course
error enrolling user to course-roleid
this is a new installation, eariler was using 402 without any issues

@turf212
Copy link
Collaborator

turf212 commented Apr 22, 2024

Does the Manual enrolment class exist on the course?

@huy-nm
Copy link

huy-nm commented Apr 22, 2024

I got the same issue with all three types of course
image

@turf212
Copy link
Collaborator

turf212 commented Apr 22, 2024

If you go to the course and click on Participants and then choose enrolment methods from the drop down, are there any listed for the course?

@huy-nm
Copy link

huy-nm commented Apr 22, 2024

If you go to the course and click on Participants and then choose enrolment methods from the drop down, are there any listed for the course?

Dropdown is disabled (for all 3 types of course)
image

@turf212
Copy link
Collaborator

turf212 commented Apr 22, 2024

That's frustrating. Looks like Moodle core has removed the enrolment methods when you create a course. Or at least when creating a course in 4.3 it's not adding them in from the IOMAD dashboard.

If you add a Manual or License enrolment method to the course it will work for now. I'll check why it's failing in the code. and fix ASAP.

@turf212
Copy link
Collaborator

turf212 commented Apr 22, 2024

More curiously, if I create the course directly in the Site admin -> Courses -> create course that still doesn't have any enrolment plugins set up. I've tested this on the latest 4.3 code from today and that is showing this behaviour.

@turf212
Copy link
Collaborator

turf212 commented Apr 22, 2024

So the issue is that the default setting for manual,guest,license, and self enrolments to be added by default to a new course hasn't been saved in the database, even though it looks like it has when you check the settings for that plugin. You can fix it for new courses by going to Site administration -> plugins -> enrolments and editing the settings for each of those plugins - first unticking the option saving, and then ticking the option and then saving again.

For courses you have created you can manually add in those enrolment types to each course from the enrolments option from the drop down.

This is only happening on new 4.3 sites, so I'm going to check a core Moodle 4.3 site and see if that issue is still there. If so I'll raise a bug with the Moodle devs, if not I'll work out why it's happening with our code and sort.

@shadyshrif
Copy link

So the issue is that the default setting for manual,guest,license, and self enrolments to be added by default to a new course hasn't been saved in the database, even though it looks like it has when you check the settings for that plugin. You can fix it for new courses by going to Site administration -> plugins -> enrolments and editing the settings for each of those plugins - first unticking the option saving, and then ticking the option and then saving again.

For courses you have created you can manually add in those enrolment types to each course from the enrolments option from the drop down.

This is only happening on new 4.3 sites, so I'm going to check a core Moodle 4.3 site and see if that issue is still there. If so I'll raise a bug with the Moodle devs, if not I'll work out why it's happening with our code and sort.

Thank you this worked for me, both solutions worked for me.
I would like to help with exploring the root cause of the issue, I will install a fresh core Moodle 4.3 site and let you know

@shadyshrif
Copy link

shadyshrif commented May 9, 2024

Hi @turf212 I tried a fresh version of Version 4.3.1 (Build: 20231211)
Simply I created a user, and a course, and then I enrolled the user to the course. it worked without any issue. So this seems to be iomad issue not core Moodle issue.
I have this fresh install, tell me if you want me to check anything in the DB, I'm happy to help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants