emeneo / moodle-enrol_apply

Moodle enrolment plugin: Enrolment upon approval
http://www.emeneoplugins.chocolatelms.com
12 stars 38 forks source link

Clean up mixup of customtext2 and customtext3 fields (for fresh installations only) #106

Closed abias closed 2 years ago

abias commented 2 years ago

In previous commits in this plugin, a mixup of the customtext2 and customtext3 fields was introduced and never cleaned up since then. https://github.com/emeneo/moodle-enrol_apply/issues/89 dealt with the fact that a DB upgrade step was missing and came to a preliminary end with the conclusion that admins should fix existing data manually when upgrading the plugin.

However, the plugin is still broken for fresh installations as well. This is because the existing code still pre-fills customtext2 with notification settings, but reads the custom label from there. As a teacher adding an enrolment instance to a course, I see the 'Custom label' field filled with '$@ALL@$' which not really makes sense.

This patch tries to clean up this mixup so that at least fresh installations (and installations where the admin has cleaned up the data manually) work well again.

Flottertotte commented 2 years ago

Thank you! On which version of moodle are you working?

abias commented 2 years ago

Thanks, @Flottertotte , for merging the PR so quickly!

If you agree with and can confirm my changes, I would like to ask to to publish a new version on https://moodle.org/plugins/enrol_apply as well.

On which version of moodle are you working?

I was testing this on Moodle 3.9 LTS, but I do not expect any other behaviour on newer versions.

Cheers, Alex

Flottertotte commented 2 years ago

Done :)

abias commented 2 years ago

Thank you, @Flottertotte !