MDL-59287 core_completion: Bulk completion now updates events.
authorAdrian Greeve <adrian@moodle.com>
Thu, 29 Jun 2017 01:08:34 +0000 (09:08 +0800)
committerAdrian Greeve <adrian@moodle.com>
Mon, 10 Jul 2017 01:40:02 +0000 (09:40 +0800)
completion/classes/manager.php

index 17f7696..2f66775 100644 (file)
@@ -320,6 +320,9 @@ class manager {
                     $needreset[] = $cm->id;
                 }
             }
+            // Update completion calendar events.
+            $completionexpected = ($data['completionexpected']) ? $data['completionexpected'] : null;
+            \core_completion\api::update_completion_date_event($cm->id, $cm->modname, $cm->instance, $completionexpected);
         }
         if ($updated) {
             // Now that modules are fully updated, also update completion data if required.