@@ -165,6 +165,19 @@ abstract public function get_settings(cm_info $cm);
165165 */
166166 abstract public function validate_dates (cm_info $ cm , array $ dates );
167167
168+ /**
169+ * Save the new dates for this course_module instance.
170+ *
171+ * @param \cm_info $cm the activity to save the dates for.
172+ * @param array $dates a list of new dates.
173+ *
174+ * @throws \coding_exception
175+ */
176+ final public function save_new_dates (cm_info $ cm , array $ dates ) {
177+ $ this ->save_dates ($ cm , $ dates );
178+ \core \event \course_module_updated::create_from_cm ($ cm )->trigger ();
179+ }
180+
168181 /**
169182 * Save the new dates for this course_module instance.
170183 * @param cm_info $cm the activity to save the dates for.
@@ -281,9 +294,20 @@ abstract public function get_settings(block_base $block);
281294 */
282295 abstract public function validate_dates (block_base $ block , array $ dates );
283296
297+ /**
298+ * Save the new dates for this block instance.
299+ *
300+ * @param \block_base $block the block to save the dates for.
301+ * @param array $dates a list of new dates.
302+ */
303+ final public function save_new_dates (block_base $ block , array $ dates ) {
304+ $ this ->save_dates ($ block , $ dates );
305+ }
306+
284307 /**
285308 * Save the new dates for this course_module instance.
286- * @param cm_info $cm the activity to save the dates for.
309+ * @param \block_base $block the block to save the dates for.
310+ * @param array $dates a list of new dates.
287311 */
288312 public function save_dates (block_base $ block , array $ dates ) {
289313 global $ DB ;
@@ -435,7 +459,7 @@ function report_editdates_update_dates_by_section($courseid, array $sectionnums,
435459
436460 $ modinstance = report_editdates_mod_data_date_extractor::make ($ cm ->modname , $ course );
437461 if ($ modinstance ) {
438- $ modinstance ->save_dates ($ cm , $ datesettings );
462+ $ modinstance ->save_new_dates ($ cm , $ datesettings );
439463 }
440464 }
441465 $ transaction ->allow_commit ();
0 commit comments