Hi all,
I'm fairly new too Moodle so not 100% sure if this is a good question or not.
I have created a 'fake' enrolment plugin so I was able to add custom fields to the course 'Edit settings' page without modifying core code. Everything is working fine apart from I can't get the custom fields to show up on older courses. The function course_edit_form is what I'm using to get the fields to display and I have managed to make it work with old courses by adding some code in course_updated function which creates instance of the plugin when the user updates the page.
Is there a function that will check if an instant exists, and add it if it doesn't exist so that the fields will show in all courses once a user clicks on "Edit settings" of a course?