Add default enrol plugins after restore

Add default enrol plugins after restore

by Michael Zehr -
Number of replies: 0

I'm configuring a site that will use course template to create a number of courses with similar structure.  We will use a defined set of enrollment plugins too.

In 2.2, when I configure a course, back it up, and then restore it to a new course, the enrollment plugins are not also restored.  It appears restoring enrollment instances is a feature of 2.4.

But not only does it not restore the enrollment plugin instances, it also doesn't add the default enrollment plugins as configured on the admin plugin forms.  (Which normally would occur through calling lib/enrollib.php's enrol_course_updated).  

Is there a relatively simple way to enable this?  Is it a matter of finding the right spot in the restore libs and calling enrol_course_updated?

I realize there are a couple workarounds -- create a new course, then restore a backup merging into current course, or manually configuring the course enrol plugins after restoring.  I want to automate things as much as possible, not just to reduce time but also to reduce the chance of errors.  (The failure mode of not having the plugins is that students see a message saying they can't enrol in a course.  They might possibly pick another course thinking that one isn't really available, and the teachers would be left wondering why no students are picking their course.)  (There's another workaround -- updating moodle, which I might end up doing anyway, but then I have a lot of retesting to do.)

Thanks for any suggestions,

Michael

 

 

Average of ratings: -