Skip to content

Commit bffb552

Browse files
committed
Merge branch 'MDL-80233-main' of https://github.com/aanabit/moodle
2 parents 19957a2 + 3f3dc5a commit bffb552

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

completion/classes/manager.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ public function apply_default_completion($data, $updatecustomrules, string $suff
528528
$data['customrules'] = $customdata ? json_encode($customdata) : null;
529529
$defaults['customrules'] = null;
530530
}
531-
$data = array_intersect_key($data, $defaults);
531+
$data = array_merge($defaults, $data);
532532

533533
// Get names of the affected modules.
534534
list($modidssql, $params) = $DB->get_in_or_equal($modids);

completion/tests/behat/default_activity_completion.feature

+10-4
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,19 @@ Feature: Allow teachers to edit the default activity completion rules in a cours
2929
And I set the field "Course completion tertiary navigation" to "Default activity completion"
3030
And I click on "Expand Assignment" "button"
3131
And I set the following fields to these values:
32-
| Add requirements | 1 |
33-
| completionview_assign | 0 |
34-
| completionusegrade_assign | 1 |
35-
| completionsubmit_assign | 1 |
32+
| Add requirements | 1 |
33+
| completionview_assign | 1 |
34+
| completionusegrade_assign | 1 |
35+
| completionsubmit_assign | 1 |
3636
And I should not see "Cancel" in the "[data-region='activitycompletion-forum']" "css_element"
3737
And I click on "Save changes" "button" in the "[data-region='activitycompletion-assign']" "css_element"
3838
Then I should see "Changes saved"
39+
And I navigate to "Course completion" in current page administration
40+
And I set the field "Course completion tertiary navigation" to "Default activity completion"
41+
And I click on "Expand Assignment" "button"
42+
And I set the following fields to these values:
43+
| completionview_assign | 0 |
44+
And I click on "Save changes" "button" in the "[data-region='activitycompletion-assign']" "css_element"
3945
And I am on "Course 1" course homepage with editing mode on
4046
And I press "Add an activity or resource"
4147
And I click on "Add a new Assignment" "link" in the "Add an activity or resource" "dialogue"

0 commit comments

Comments
 (0)