mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 01:10:58 +01:00
T6555, When creating a task with a non existing parent parameter, phabricator should 404
Summary: Fixes T6555, The following should 404: /maniphest/task/create/?parent=asdf, /maniphest/task/create/?parent=0, /maniphest/task/create/?parent=999999 (where T999999 does not exist) Test Plan: Navigate to /maniphest/task/create/?parent=asdf or /maniphest/task/create/?parent=0 or /maniphest/task/create/?parent=999999 (where T999999 does not exist). See 404. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6555 Differential Revision: https://secure.phabricator.com/D11258
This commit is contained in:
parent
648fa2e1bc
commit
9c568802bb
1 changed files with 4 additions and 1 deletions
|
@ -126,11 +126,14 @@ final class ManiphestTaskEditController extends ManiphestController {
|
|||
|
||||
// You can only have a parent task if you're creating a new task.
|
||||
$parent_id = $request->getInt('parent');
|
||||
if ($parent_id) {
|
||||
if (strlen($parent_id)) {
|
||||
$parent_task = id(new ManiphestTaskQuery())
|
||||
->setViewer($user)
|
||||
->withIDs(array($parent_id))
|
||||
->executeOne();
|
||||
if (!$parent_task) {
|
||||
return new Aphront404Response();
|
||||
}
|
||||
if (!$template_id) {
|
||||
$template_id = $parent_id;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue