diff --git a/src/applications/files/controller/PhabricatorFileListController.php b/src/applications/files/controller/PhabricatorFileListController.php index d3c1322607..3f307569b8 100644 --- a/src/applications/files/controller/PhabricatorFileListController.php +++ b/src/applications/files/controller/PhabricatorFileListController.php @@ -10,7 +10,7 @@ final class PhabricatorFileListController extends PhabricatorFileController } public function willProcessRequest(array $data) { - $this->key = idx($data, 'key', 'authored'); + $this->key = idx($data, 'key'); } public function processRequest() { diff --git a/src/applications/macro/controller/PhabricatorMacroListController.php b/src/applications/macro/controller/PhabricatorMacroListController.php index 95a0ab1f41..e1f03fd574 100644 --- a/src/applications/macro/controller/PhabricatorMacroListController.php +++ b/src/applications/macro/controller/PhabricatorMacroListController.php @@ -10,7 +10,7 @@ final class PhabricatorMacroListController extends PhabricatorMacroController } public function willProcessRequest(array $data) { - $this->key = idx($data, 'key', 'active'); + $this->key = idx($data, 'key'); } public function processRequest() { diff --git a/src/applications/paste/controller/PhabricatorPasteListController.php b/src/applications/paste/controller/PhabricatorPasteListController.php index 385e0ecc8c..7e4f972490 100644 --- a/src/applications/paste/controller/PhabricatorPasteListController.php +++ b/src/applications/paste/controller/PhabricatorPasteListController.php @@ -10,7 +10,7 @@ final class PhabricatorPasteListController extends PhabricatorPasteController } public function willProcessRequest(array $data) { - $this->queryKey = idx($data, 'queryKey', 'all'); + $this->queryKey = idx($data, 'queryKey'); } public function processRequest() { diff --git a/src/applications/people/controller/PhabricatorPeopleListController.php b/src/applications/people/controller/PhabricatorPeopleListController.php index beda82486d..b81397003c 100644 --- a/src/applications/people/controller/PhabricatorPeopleListController.php +++ b/src/applications/people/controller/PhabricatorPeopleListController.php @@ -14,7 +14,7 @@ final class PhabricatorPeopleListController extends PhabricatorPeopleController } public function willProcessRequest(array $data) { - $this->key = idx($data, 'key', 'all'); + $this->key = idx($data, 'key'); } public function processRequest() { diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php index 814595593c..40ad447857 100644 --- a/src/applications/search/controller/PhabricatorApplicationSearchController.php +++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php @@ -96,11 +96,13 @@ final class PhabricatorApplicationSearchController if ($this->queryKey == 'advanced') { $run_query = false; $query_key = $request->getStr('query'); + } else if (!strlen($this->queryKey)) { + $query_key = head_key($engine->loadEnabledNamedQueries()); } if ($engine->isBuiltinQuery($query_key)) { $saved_query = $engine->buildSavedQueryFromBuiltin($query_key); - $named_query = $engine->getBuiltinQuery($query_key); + $named_query = idx($engine->loadEnabledNamedQueries(), $query_key); } else if ($query_key) { $saved_query = id(new PhabricatorSavedQueryQuery()) ->setViewer($user) @@ -111,12 +113,7 @@ final class PhabricatorApplicationSearchController return new Aphront404Response(); } - $named_query = id(new PhabricatorNamedQueryQuery()) - ->setViewer($user) - ->withQueryKeys(array($saved_query->getQueryKey())) - ->withEngineClassNames(array(get_class($engine))) - ->withUserPHIDs(array($user->getPHID())) - ->executeOne(); + $named_query = idx($engine->loadEnabledNamedQueries(), $query_key); } else { $saved_query = $engine->buildSavedQueryFromRequest($request); }