From 4506018339a0f6950cb9b1acb7a50894fc2f2ed5 Mon Sep 17 00:00:00 2001 From: lkassianik Date: Mon, 8 Dec 2014 11:27:15 -0800 Subject: [PATCH] Clicking the search icon in empty search field should link to advanced search Summary: Fixes T6664, clicking search icon in empty search field should link to advanced search Test Plan: navigate to home page, click search icon or click into search box and hit enter. Advanced search page should open. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6664 Differential Revision: https://secure.phabricator.com/D10947 --- .../search/controller/PhabricatorSearchController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/applications/search/controller/PhabricatorSearchController.php b/src/applications/search/controller/PhabricatorSearchController.php index 9680e33d5e..bacb0cb3c0 100644 --- a/src/applications/search/controller/PhabricatorSearchController.php +++ b/src/applications/search/controller/PhabricatorSearchController.php @@ -39,6 +39,11 @@ final class PhabricatorSearchController // with only this piece of somewhat-sketchy code. See discussion in T4365. if ($request->getBool('search:primary')) { + if (!strlen($request->getStr('query'))) { + $advanced_uri = '/search/query/advanced/'; + return id(new AphrontRedirectResponse())->setURI($advanced_uri); + } + $named_queries = $engine->loadEnabledNamedQueries(); if ($named_queries) { $named = head($named_queries);