moodle-local_recompletion icon indicating copy to clipboard operation
moodle-local_recompletion copied to clipboard

local_recompletion_config enable value is always set to 1

Open davidpesce opened this issue 1 year ago • 1 comments

I think this is where it occurred: https://github.com/danmarsden/moodle-local_recompletion/commit/c5eb4f4d96ee4e34c37bbb6ab3744a4988078d55

But we were using the absence of records in the local_recompletion_config table to determine which courses had a recompletion duration set. With the latest version of the recompletion plugin, this has changed. All courses have config values present within the table and the enable value is set to 1.

Ideally, if recompletion is disabled, the local_recompletion_config enable value would be set to zero.

davidpesce avatar Apr 12 '24 19:04 davidpesce

I did a bit more digging on this and I think it's related to Alex's issue here: https://github.com/danmarsden/moodle-local_recompletion/issues/160

The reason we were getting an entry for every course was because the default settings were to enable. We restored a catalog of courses and it created all the local_recompletion_config entries and enabled was set to 1. Even after disabling recompletion (at the course level), the values in local_recompletion_config remained the same.

Leaving the courses in Moodle, uninstalling recompletion, then resintalling recompletion, and setting the defaults to disabled results in no entries in the local_recompletion_config table.

Moodle 4.1.9+ (Build: 20240308) PHP 7.4.3

davidpesce avatar Apr 12 '24 20:04 davidpesce

the "enable" setting has been replaced by a "recompletiontype" setting and the old enabled value has now been deleted: https://github.com/danmarsden/moodle-local_recompletion/blob/MOODLE_403_STABLE/db/upgrade.php#L690

Closing this one off as it doesn't related to current code - thanks!

danmarsden avatar May 18 '24 00:05 danmarsden