1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00

Fix project view and edit uris on creation

Summary: Fixes T6305, sets edit and view uris later in the stack.

Test Plan: Create and edit a project in /project/. Create a project in a dialog. Get redirected to correct place. Verify Cancel send you back to home.

Reviewers: epriestley, btrahan

Reviewed By: btrahan

Subscribers: Korvin, epriestley

Maniphest Tasks: T6305

Differential Revision: https://secure.phabricator.com/D10702
This commit is contained in:
Chad Little 2014-10-14 09:55:52 -07:00
parent af4ebc67c6
commit 13aa443e2d

View file

@ -46,9 +46,6 @@ final class PhabricatorProjectEditDetailsController
->setViewer($viewer)
->readFieldsFromStorage($project);
$view_uri = $this->getApplicationURI('view/'.$project->getID().'/');
$edit_uri = $this->getApplicationURI('edit/'.$project->getID().'/');
$e_name = true;
$e_slugs = false;
$e_edit = null;
@ -151,9 +148,11 @@ final class PhabricatorProjectEditDetailsController
}
if ($is_new) {
$redirect_uri = $view_uri;
$redirect_uri =
$this->getApplicationURI('view/'.$project->getID().'/');
} else {
$redirect_uri = $edit_uri;
$redirect_uri =
$this->getApplicationURI('edit/'.$project->getID().'/');
}
return id(new AphrontRedirectResponse())->setURI($redirect_uri);
@ -288,7 +287,7 @@ final class PhabricatorProjectEditDetailsController
$form->appendChild(
id(new AphrontFormSubmitControl())
->addCancelButton($edit_uri)
->addCancelButton($this->getApplicationURI())
->setValue(pht('Save')));
$form_box = id(new PHUIObjectBoxView())
@ -301,8 +300,10 @@ final class PhabricatorProjectEditDetailsController
$crumbs->addTextCrumb($title);
} else {
$crumbs
->addTextCrumb($project->getName(), $view_uri)
->addTextCrumb(pht('Edit'), $edit_uri)
->addTextCrumb($project->getName(),
$this->getApplicationURI('view/'.$project->getID().'/'))
->addTextCrumb(pht('Edit'),
$this->getApplicationURI('edit/'.$project->getID().'/'))
->addTextCrumb(pht('Details'));
}