From b8fafdbd908ccbaa9c1f8a54bf25216d3b08f530 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 19 Mar 2014 19:25:31 -0700 Subject: [PATCH] Fix Passphrase cancel URI Summary: The "Cancel" button on the "Edit Credential" interface doesn't go back to the "View Credential" interface for existing credentials. Test Plan: Clicked "Cancel" on both "create" and "edit" workflows. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D8568 --- .../controller/PassphraseCredentialEditController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/applications/passphrase/controller/PassphraseCredentialEditController.php b/src/applications/passphrase/controller/PassphraseCredentialEditController.php index 0ceaf1738a..3f241b3d6a 100644 --- a/src/applications/passphrase/controller/PassphraseCredentialEditController.php +++ b/src/applications/passphrase/controller/PassphraseCredentialEditController.php @@ -272,6 +272,7 @@ final class PassphraseCredentialEditController extends PassphraseController { $title = pht('Create Credential'); $header = pht('Create New Credential'); $crumbs->addTextCrumb(pht('Create')); + $cancel_uri = $this->getApplicationURI(); } else { $title = pht('Edit Credential'); $header = pht('Edit Credential %s', 'K'.$credential->getID()); @@ -279,6 +280,7 @@ final class PassphraseCredentialEditController extends PassphraseController { 'K'.$credential->getID(), '/K'.$credential->getID()); $crumbs->addTextCrumb(pht('Edit')); + $cancel_uri = '/K'.$credential->getID(); } if ($request->isAjax()) { @@ -293,7 +295,7 @@ final class PassphraseCredentialEditController extends PassphraseController { ->appendChild($errors) ->appendChild($form->buildLayoutView()) ->addSubmitButton(pht('Create Credential')) - ->addCancelButton($this->getApplicationURI()); + ->addCancelButton($cancel_uri); return id(new AphrontDialogResponse())->setDialog($dialog); } @@ -301,7 +303,7 @@ final class PassphraseCredentialEditController extends PassphraseController { $form->appendChild( id(new AphrontFormSubmitControl()) ->setValue(pht('Save')) - ->addCancelButton($this->getApplicationURI())); + ->addCancelButton($cancel_uri)); $box = id(new PHUIObjectBoxView()) ->setHeaderText($header)