diff --git a/src/applications/calendar/storage/PhabricatorCalendarEvent.php b/src/applications/calendar/storage/PhabricatorCalendarEvent.php index e566a77b76..3a09d2e021 100644 --- a/src/applications/calendar/storage/PhabricatorCalendarEvent.php +++ b/src/applications/calendar/storage/PhabricatorCalendarEvent.php @@ -391,6 +391,10 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO return ($epoch - $window); } + public function getEndDateTimeEpochForCache() { + return $this->getEndDateTimeEpoch(); + } + protected function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, diff --git a/src/applications/people/query/PhabricatorPeopleQuery.php b/src/applications/people/query/PhabricatorPeopleQuery.php index 7367382e50..e756a9a4fd 100644 --- a/src/applications/people/query/PhabricatorPeopleQuery.php +++ b/src/applications/people/query/PhabricatorPeopleQuery.php @@ -465,7 +465,7 @@ final class PhabricatorPeopleQuery while (true) { foreach ($events as $event) { $from = $event->getStartDateTimeEpochForCache(); - $to = $event->getEndDateTimeEpoch(); + $to = $event->getEndDateTimeEpochForCache(); if (($from <= $cursor) && ($to > $cursor)) { $cursor = $to; if (!$next_event) { @@ -483,7 +483,7 @@ final class PhabricatorPeopleQuery $availability_type = $invitee->getDisplayAvailability($next_event); $availability = array( 'until' => $cursor, - 'eventPHID' => $event->getPHID(), + 'eventPHID' => $next_event->getPHID(), 'availability' => $availability_type, ); @@ -496,7 +496,7 @@ final class PhabricatorPeopleQuery // simultaneously we should accommodate that. However, it's complex // to compute, rare, and probably not confusing most of the time. - $availability_ttl = $next_event->getStartDateTimeEpochForCache(); + $availability_ttl = $next_event->getEndDateTimeEpochForCache(); } else { $availability = array( 'until' => null, diff --git a/src/applications/people/storage/PhabricatorUser.php b/src/applications/people/storage/PhabricatorUser.php index 4a35d9956c..2a1c1394a6 100644 --- a/src/applications/people/storage/PhabricatorUser.php +++ b/src/applications/people/storage/PhabricatorUser.php @@ -1082,7 +1082,7 @@ final class PhabricatorUser 'UPDATE %T SET availabilityCache = %s, availabilityCacheTTL = %nd WHERE id = %d', $this->getTableName(), - json_encode($availability), + phutil_json_encode($availability), $ttl, $this->getID()); unset($unguarded);