MDL-78676 mod_data: Check completion rules properly
The completion_rule_enabled() method was not checking all the fields and, in some cases, it was returning false (because it was not checking that "Count of entries" field was enabled).
This commit is contained in:
@@ -145,7 +145,7 @@ class mod_data_mod_form extends moodleform_mod {
|
||||
* @return bool True if one or more rules is enabled, false if none are.
|
||||
*/
|
||||
public function completion_rule_enabled($data) {
|
||||
return ($data['completionentries'] != 0);
|
||||
return (!empty($data['completionentriesenabled']) && $data['completionentries'] != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user