From ace7505f2e9808786f630a6b7906c6c1fa4822d6 Mon Sep 17 00:00:00 2001 From: lkassianik Date: Mon, 8 Jun 2015 11:58:45 -0700 Subject: [PATCH] Check if recurrence end date is disabled before saving it. Summary: Ref T8357, Check if recurrence end date is disabled before saving it. Test Plan: Create new event, before saving, leave "recurrence end date" unchecked, save, should not get an error. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Maniphest Tasks: T8357 Differential Revision: https://secure.phabricator.com/D13212 --- .../PhabricatorCalendarEventEditController.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php b/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php index 72422e03e2..85ee099de9 100644 --- a/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php @@ -201,10 +201,12 @@ final class PhabricatorCalendarEventEditController PhabricatorCalendarEventTransaction::TYPE_FREQUENCY) ->setNewValue(array('rule' => $frequency)); - $xactions[] = id(new PhabricatorCalendarEventTransaction()) - ->setTransactionType( - PhabricatorCalendarEventTransaction::TYPE_RECURRENCE_END_DATE) - ->setNewValue($recurrence_end_date_value); + if (!$recurrence_end_date_value->isDisabled()) { + $xactions[] = id(new PhabricatorCalendarEventTransaction()) + ->setTransactionType( + PhabricatorCalendarEventTransaction::TYPE_RECURRENCE_END_DATE) + ->setNewValue($recurrence_end_date_value); + } } $xactions[] = id(new PhabricatorCalendarEventTransaction())