mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-59393 calendar: use event context in update_event_start_day
This commit is contained in:
parent
28e030d9f9
commit
ca518350ff
@ -947,9 +947,6 @@ class core_calendar_external extends external_api {
|
||||
'dayTimestamp' => $dayTimestamp,
|
||||
]);
|
||||
|
||||
$context = \context_user::instance($USER->id);
|
||||
self::validate_context($context);
|
||||
|
||||
$vault = event_container::get_event_vault();
|
||||
$mapper = event_container::get_event_mapper();
|
||||
$event = $vault->get_event_by_id($eventId);
|
||||
@ -964,6 +961,8 @@ class core_calendar_external extends external_api {
|
||||
print_error('nopermissiontoupdatecalendar');
|
||||
}
|
||||
|
||||
self::validate_context($legacyevent->context);
|
||||
|
||||
$newdate = usergetdate($dayTimestamp);
|
||||
$startdatestring = implode('-', [$newdate['year'], $newdate['mon'], $newdate['mday']]);
|
||||
$startdate = new DateTimeImmutable($startdatestring);
|
||||
|
Loading…
x
Reference in New Issue
Block a user