Skip to content

Commit

Permalink
DST error handling when offset for transition is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
danbar0kal committed Feb 23, 2025
1 parent 97c6a10 commit 59aaf3c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api_v3/lib/KalturaErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
8 changes: 8 additions & 0 deletions plugins/schedule/base/lib/api/KalturaScheduleEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

}
Expand Down

0 comments on commit 59aaf3c

Please sign in to comment.