From 363084d4fa91c36938d79532dbe7372154b01530 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 6 Jan 2017 13:29:30 -0800 Subject: [PATCH] Fix an issue where setting a recurrence end date on a Calendar event without one could fatal Summary: Ref T11816. The underlying format of recurrence end dates swapped around a bit and we now try to compare `null` to a valid date if you're setting it for the first time. Test Plan: - On a new event, set a recurrence end date. - Then, removed a recurrence end date. Reviewers: chad Reviewed By: chad Maniphest Tasks: T11816 Differential Revision: https://secure.phabricator.com/D17150 --- .../xaction/PhabricatorCalendarEventDateTransaction.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/applications/calendar/xaction/PhabricatorCalendarEventDateTransaction.php b/src/applications/calendar/xaction/PhabricatorCalendarEventDateTransaction.php index 38e044b3d6..b79a560422 100644 --- a/src/applications/calendar/xaction/PhabricatorCalendarEventDateTransaction.php +++ b/src/applications/calendar/xaction/PhabricatorCalendarEventDateTransaction.php @@ -23,6 +23,14 @@ abstract class PhabricatorCalendarEventDateTransaction } public function getTransactionHasEffect($object, $old, $new) { + // If either value is `null` (for example, when setting a recurring event + // end date for the first time) and the other value is not `null`, this + // transaction has an effect. + $has_null = (($old === null) || ($new === null)); + if ($has_null) { + return ($old !== $new); + } + $editor = $this->getEditor(); $actor = $this->getActor();