diff --git a/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php b/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php index 8614e68f56..c23996470d 100644 --- a/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php +++ b/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php @@ -266,7 +266,6 @@ final class PhabricatorCalendarEventSearchEngine $list = new PHUIObjectItemListView(); foreach ($events as $event) { - $duration = ''; $event_date_info = $this->getEventDateLabel($event); $creator_handle = $handles[$event->getUserPHID()]; $attendees = array(); @@ -275,18 +274,6 @@ final class PhabricatorCalendarEventSearchEngine $attendees[] = $invitee->getInviteePHID(); } - $attendees = pht( - 'Attending: %s', - $viewer->renderHandleList($attendees) - ->setAsInline(1) - ->render()); - - if (strlen($event->getDuration()) > 0) { - $duration = pht( - 'Duration: %s', - $event->getDuration()); - } - if ($event->getIsGhostEvent()) { $title_text = $event->getMonogram() .' (' @@ -302,9 +289,25 @@ final class PhabricatorCalendarEventSearchEngine ->setObject($event) ->setHeader($title_text) ->setHref($event->getURI()) - ->addAttribute($event_date_info) - ->addAttribute($attendees) - ->addIcon('none', $duration); + ->addAttribute($event_date_info); + + if ($attendees) { + $attending = pht( + 'Attending: %s', + $viewer->renderHandleList($attendees) + ->setAsInline(1) + ->render()); + + $item->addAttribute($attending); + } + + if (strlen($event->getDuration()) > 0) { + $duration = pht( + 'Duration: %s', + $event->getDuration()); + + $item->addIcon('none', $duration); + } $list->addItem($item); }