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:
Sara Arjona
2023-07-07 18:28:23 +02:00
parent f29f757f5f
commit e8897600a1
+1 -1
View File
@@ -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);
}
/**