When resetting a course in moodle the simplecertificate_reset_userdata function (lib.php) is called which, if the course reset includes a 'timeshift', tries to apply date operations to non-existent database columns 'timeopen' and 'timeclose' (lines 120-123).
This in turn causes an unrecoverable error that breaks the reset operation.
To reproduce:
Create a course ensuring that a non-midnight start date is specified
Add a simple certificate to the course
Reset the course setting a new start date, but keeping the same non-midnight time
The solution to the issue is to either a) remove the 'timeshift' code if it is not needed or b) update the code to only modify appropriate database columns.
This error seems to have originated from the original creation of the plugin being based on an activity which does have the 'timeopen' and 'timeopen' database columns.
When resetting a course in moodle the simplecertificate_reset_userdata function (lib.php) is called which, if the course reset includes a 'timeshift', tries to apply date operations to non-existent database columns 'timeopen' and 'timeclose' (lines 120-123).
This in turn causes an unrecoverable error that breaks the reset operation.
To reproduce:
The solution to the issue is to either a) remove the 'timeshift' code if it is not needed or b) update the code to only modify appropriate database columns.
This error seems to have originated from the original creation of the plugin being based on an activity which does have the 'timeopen' and 'timeopen' database columns.