From 8f94164df348c0bc71f18010fbe55b9f0386b9ce Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Wed, 5 Nov 2014 16:51:55 +0800 Subject: [PATCH] MDL-47174 events: new calendar event may have 0 timestart --- lib/classes/event/calendar_event_created.php | 2 +- lib/classes/event/calendar_event_deleted.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/classes/event/calendar_event_created.php b/lib/classes/event/calendar_event_created.php index 399b943aae1..28c47a07e71 100644 --- a/lib/classes/event/calendar_event_created.php +++ b/lib/classes/event/calendar_event_created.php @@ -107,7 +107,7 @@ class calendar_event_created extends base { if (empty($this->other['name'])) { throw new \coding_exception('The \'name\' value must be set in other.'); } - if (empty($this->other['timestart'])) { + if (!isset($this->other['timestart'])) { throw new \coding_exception('The \'timestart\' value must be set in other.'); } } diff --git a/lib/classes/event/calendar_event_deleted.php b/lib/classes/event/calendar_event_deleted.php index 4de8aa04a11..933f0b075dc 100644 --- a/lib/classes/event/calendar_event_deleted.php +++ b/lib/classes/event/calendar_event_deleted.php @@ -88,7 +88,7 @@ class calendar_event_deleted extends base { if (empty($this->other['name'])) { throw new \coding_exception('The \'name\' value must be set in other.'); } - if (empty($this->other['timestart'])) { + if (!isset($this->other['timestart'])) { throw new \coding_exception('The \'timestart\' value must be set in other.'); } }