1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 03:50:54 +01:00

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
This commit is contained in:
epriestley 2017-01-06 13:29:30 -08:00
parent 5ff02058a4
commit 363084d4fa

View file

@ -23,6 +23,14 @@ abstract class PhabricatorCalendarEventDateTransaction
} }
public function getTransactionHasEffect($object, $old, $new) { 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(); $editor = $this->getEditor();
$actor = $this->getActor(); $actor = $this->getActor();