CC-5725: Changing a show's repeat type removes first instance from repeating series
This commit is contained in:
parent
51b5cc2052
commit
35fd639c1c
|
@ -1545,15 +1545,23 @@ SQL;
|
||||||
if (is_null($endDate) || $startDateTimeClone->getTimestamp() <= $endDateTime->getTimestamp()) {
|
if (is_null($endDate) || $startDateTimeClone->getTimestamp() <= $endDateTime->getTimestamp()) {
|
||||||
|
|
||||||
if ($this->isUpdate) {
|
if ($this->isUpdate) {
|
||||||
$showDay = CcShowDaysQuery::create()
|
if ($this->repeatType >= 0) {
|
||||||
->filterByDbShowId($showId)
|
$showDay = CcShowDaysQuery::create()
|
||||||
->filterByDbRepeatType($this->origCcShowDay->getDbRepeatType())
|
->filterByDbShowId($showId)
|
||||||
->filterByDbDay($this->origCcShowDay->getDbDay())
|
->filterByDbRepeatType($this->repeatType)
|
||||||
->findOne();
|
->filterByDbDay($day)
|
||||||
if (!$showDay) {
|
->findOne();
|
||||||
//if no show day object was found it is because a new
|
if (!$showDay) {
|
||||||
//repeating day of the week was added
|
//if no show day object was found it is because a new
|
||||||
$showDay = new CcShowDays();
|
//repeating day of the week was added
|
||||||
|
$showDay = new CcShowDays();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$showDay = CcShowDaysQuery::create()
|
||||||
|
->filterByDbShowId($showId)
|
||||||
|
->filterByDbRepeatType($this->origCcShowDay->getDbRepeatType())
|
||||||
|
->filterByDbDay($this->origCcShowDay->getDbDay())
|
||||||
|
->findOne();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$showDay = new CcShowDays();
|
$showDay = new CcShowDays();
|
||||||
|
|
Loading…
Reference in New Issue