mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-46991 Availability: Conditional dates not updated on restore
This commit is contained in:
parent
272fec367f
commit
5176504d3f
8 changed files with 158 additions and 55 deletions
|
@ -209,4 +209,15 @@ class condition extends \core_availability\condition {
|
|||
protected static function is_midnight($time) {
|
||||
return usergetmidnight($time) == $time;
|
||||
}
|
||||
|
||||
public function update_after_restore(
|
||||
$restoreid, $courseid, \base_logger $logger, $name) {
|
||||
// Update the date, if restoring with changed date.
|
||||
$dateoffset = \core_availability\info::get_restore_date_offset($restoreid);
|
||||
if ($dateoffset) {
|
||||
$this->time += $dateoffset;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue