diff --git a/api_v3/lib/KalturaErrors.php b/api_v3/lib/KalturaErrors.php index 963ee9a99d..f31719d170 100644 --- a/api_v3/lib/KalturaErrors.php +++ b/api_v3/lib/KalturaErrors.php @@ -75,6 +75,8 @@ class KalturaErrors extends APIErrors const PROPERTY_VALIDATION_ALL_MUST_BE_NULL_BUT_ONE = "PROPERTY_VALIDATION_ALL_MUST_BE_NULL_BUT_ONE;PROP_NAME;Only one of the passed properties: @PROP_NAME@ should not be null"; + const PROPERTY_VALIDATION_NOT_VALID = "PROPERTY_VALIDATION_UNTIL_NOT_VALID;PROP_NAME;The property \"@PROP_NAME@\" is not valid"; + const PROPERTY_VALIDATION_MIN_LENGTH = "PROPERTY_VALIDATION_MIN_LENGTH;PROP_NAME,MIN_LEN;The property \"@PROP_NAME@\" must have a min length of @MIN_LEN@ characters"; const PROPERTY_VALIDATION_MAX_LENGTH = "PROPERTY_VALIDATION_MAX_LENGTH;PROP_NAME,MAX_LEN;The property \"@PROP_NAME@\" cannot have more than @MAX_LEN@ characters"; diff --git a/plugins/schedule/base/lib/api/KalturaScheduleEvent.php b/plugins/schedule/base/lib/api/KalturaScheduleEvent.php index 41e259f0f2..5ef8f28c9e 100644 --- a/plugins/schedule/base/lib/api/KalturaScheduleEvent.php +++ b/plugins/schedule/base/lib/api/KalturaScheduleEvent.php @@ -393,6 +393,14 @@ private function validateRecurringEventForInsert() } $this->validatePropertyNotNull('recurrence'); + if ($this->recurrence instanceof KalturaScheduleEventRecurrence) + { + if ($this->recurrence->until && $this->recurrence->until < $this->endDate) + { + throw new KalturaAPIException(KalturaErrors::PROPERTY_VALIDATION_NOT_VALID, 'Recurrence::until'); + } + } + $this->validatePropertyNotNull('duration'); } diff --git a/plugins/schedule/base/lib/iCal/kSchedulingICalEvent.php b/plugins/schedule/base/lib/iCal/kSchedulingICalEvent.php index 63d6b1c3ae..3a866ef0d4 100644 --- a/plugins/schedule/base/lib/iCal/kSchedulingICalEvent.php +++ b/plugins/schedule/base/lib/iCal/kSchedulingICalEvent.php @@ -503,7 +503,7 @@ public function addVtimeZoneBlock(KalturaScheduleEvent $event = null, &$timeZone } } array_unshift($relevantTransitions, $initialTransition); - + // Create VTIMEZONE block content $timeZoneBlockArray[] = $this->writeField(strtoupper(self::$timeZoneField), $this->timeZoneId);