danmarsden/moodle-local_recompletion

local_recompletion_config enable value is always set to 1

davidpesce opened this issue · 2 comments

I think this is where it occurred: c5eb4f4

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.

I did a bit more digging on this and I think it's related to Alex's issue here: #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

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!