From bab9a28ab98b35c9bfb4b3e2316d261992780d08 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 17 Sep 2013 11:30:48 -0700 Subject: [PATCH] Fix excel export of builtin queries Summary: This works fine for custom queries, but not for builtins. Test Plan: Exported a builtin query. Reviewers: btrahan Reviewed By: btrahan CC: hach-que, aran Differential Revision: https://secure.phabricator.com/D7015 --- .../maniphest/controller/ManiphestExportController.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/applications/maniphest/controller/ManiphestExportController.php b/src/applications/maniphest/controller/ManiphestExportController.php index b0c39737fc..1872efc97c 100644 --- a/src/applications/maniphest/controller/ManiphestExportController.php +++ b/src/applications/maniphest/controller/ManiphestExportController.php @@ -60,7 +60,14 @@ final class ManiphestExportController extends ManiphestController { ->withQueryKeys(array($this->key)) ->executeOne(); if (!$saved) { - return new Aphront404Response(); + $engine = id(new ManiphestTaskSearchEngine()) + ->setViewer($user); + if ($engine->isBuiltinQuery($this->key)) { + $saved = $engine->buildSavedQueryFromBuiltin($this->key); + } + if (!$saved) { + return new Aphront404Response(); + } } $formats = ManiphestExcelFormat::loadAllFormats();