1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

Fixes broken search if no task ids created by D2771.

Summary: I forgot to handle the case where there was no task ids entered in D2771, but this corrects that issue.

Test Plan: Search with no task ids...

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1365

Differential Revision: https://secure.phabricator.com/D2773
This commit is contained in:
Jonathan Lomas 2012-06-16 06:27:21 -07:00 committed by epriestley
parent 5b6713f3c1
commit 92fac31215

View file

@ -662,22 +662,24 @@ final class ManiphestTaskListController extends ManiphestController {
$exclude_project_phids = $request->getStrList('xprojects');
$task_ids = $request->getStrList('tasks');
// We only need the integer portion of each task ID, so get rid of any non-
// numeric elements
$numeric_task_ids = array();
if ($task_ids) {
// We only need the integer portion of each task ID, so get rid of any
// non-numeric elements
$numeric_task_ids = array();
foreach ($task_ids as $task_id) {
$task_id = preg_replace('/[a-zA-Z]+/', '', $task_id);
if (!empty($task_id)) {
$numeric_task_ids[] = $task_id;
foreach ($task_ids as $task_id) {
$task_id = preg_replace('/[a-zA-Z]+/', '', $task_id);
if (!empty($task_id)) {
$numeric_task_ids[] = $task_id;
}
}
}
if (empty($numeric_task_ids)) {
$numeric_task_ids = array(null);
}
if (empty($numeric_task_ids)) {
$numeric_task_ids = array(null);
}
$task_ids = $numeric_task_ids;
$task_ids = $numeric_task_ids;
}
$owner_phids = $request->getStrList('owners');
$author_phids = $request->getStrList('authors');