From bf2f599abb1effc67055d7db4777f50404948c5b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 27 Nov 2013 12:18:10 -0800 Subject: [PATCH] Fix Maniphest Next button not working when default query has 100+ results. Summary: If there is no /query in the URL, the default query would be lost when clicking Next, causing the search form to be shown on the second page. This is not so likely to happen on a standard Phabricator installation because the default query is Assigned, and few people will have 100+ tasks assigned. Test Plan: * Go to /maniphest/query/edit/ * Move Open Tasks to the top * Go to /maniphest/ * Click Next on the bottom right * See only tasks that are actually open Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley CC: Korvin, epriestley, aran Differential Revision: https://secure.phabricator.com/D7667 --- ...PhabricatorApplicationSearchController.php | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php index 918ccf34f2..c6c0f2acc0 100644 --- a/src/applications/search/controller/PhabricatorApplicationSearchController.php +++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php @@ -107,11 +107,24 @@ final class PhabricatorApplicationSearchController $run_query = false; $query_key = $request->getStr('query'); } else if (!strlen($this->queryKey)) { - if ($request->isHTTPGet() && $request->getPassthroughRequestData()) { + $found_query_data = false; + + if ($request->isHTTPGet()) { // If this is a GET request and it has some query data, don't - // do anything. We'll build and execute a query from it below. - // This allows external tools to build URIs like "/query/?users=a,b". - } else { + // do anything unless it's only before= or after=. We'll build and + // execute a query from it below. This allows external tools to build + // URIs like "/query/?users=a,b". + $pt_data = $request->getPassthroughRequestData(); + + foreach ($pt_data as $pt_key => $pt_value) { + if ($pt_key != 'before' && $pt_key != 'after') { + $found_query_data = true; + break; + } + } + } + + if (!$found_query_data) { // Otherwise, there's no query data so just run the user's default // query for this application. $query_key = head_key($engine->loadEnabledNamedQueries());