Page MenuHomePhabricator

D16898.diff
No OneTemporary

D16898.diff

diff --git a/src/applications/calendar/controller/PhabricatorCalendarExportICSController.php b/src/applications/calendar/controller/PhabricatorCalendarExportICSController.php
--- a/src/applications/calendar/controller/PhabricatorCalendarExportICSController.php
+++ b/src/applications/calendar/controller/PhabricatorCalendarExportICSController.php
@@ -82,6 +82,9 @@
$saved->setParameter('rangeEnd', null);
$saved->setParameter('upcoming', null);
+ // The "month" and "day" display modes imply time ranges.
+ $saved->setParameter('display', 'list');
+
$query = $engine->buildQueryFromSavedQuery($saved);
$events = $query
diff --git a/src/applications/calendar/query/PhabricatorCalendarEventQuery.php b/src/applications/calendar/query/PhabricatorCalendarEventQuery.php
--- a/src/applications/calendar/query/PhabricatorCalendarEventQuery.php
+++ b/src/applications/calendar/query/PhabricatorCalendarEventQuery.php
@@ -172,7 +172,6 @@
}
$raw_limit = $this->getRawResultLimit();
-
if (!$raw_limit && !$this->rangeEnd) {
throw new Exception(
pht(
diff --git a/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php b/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
--- a/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
+++ b/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
@@ -82,6 +82,18 @@
);
}
+ public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) {
+ $query = parent::buildQueryFromSavedQuery($saved);
+
+ // If this is an export query for generating an ".ics" file, don't
+ // build ghost events.
+ if ($saved->getParameter('export')) {
+ $query->setGenerateGhosts(false);
+ }
+
+ return $query;
+ }
+
protected function buildQueryFromParameters(array $map) {
$query = $this->newQuery();
$viewer = $this->requireViewer();
@@ -125,13 +137,7 @@
$query->withImportSourcePHIDs($map['importSourcePHIDs']);
}
- // Generate ghosts (and ignore stub events) if we aren't querying for
- // specific events or exporting.
- if (!empty($map['export'])) {
- // This is a specific mode enabled by event exports.
- $query
- ->withIsStub(false);
- } else if (!$map['ids'] && !$map['phids']) {
+ if (!$map['ids'] && !$map['phids']) {
$query
->withIsStub(false)
->setGenerateGhosts(true);

File Metadata

Mime Type
text/plain
Expires
Thu, Jun 20, 3:41 AM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6289363
Default Alt Text
D16898.diff (2 KB)

Event Timeline