From fb3ae72e367f5ec57c706593d67975c4630463c6 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 13 Aug 2018 09:31:13 -0700 Subject: [PATCH] When cancelling addition of an Almanac interface, return to the Device page Summary: Fixes T13184. In Almanac, interfaces are always added to devices. However, if you "Add New Interface" and then "Cancel", you go to the nonexistent `/interface/` page. Instead, return to the device page. Test Plan: From a device page, clicked "Add Interface" and then "Cancel". Ended up back where I was. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13184 Differential Revision: https://secure.phabricator.com/D19573 --- src/applications/almanac/editor/AlmanacInterfaceEditEngine.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/applications/almanac/editor/AlmanacInterfaceEditEngine.php b/src/applications/almanac/editor/AlmanacInterfaceEditEngine.php index 2c68ed0374..30c371d6f9 100644 --- a/src/applications/almanac/editor/AlmanacInterfaceEditEngine.php +++ b/src/applications/almanac/editor/AlmanacInterfaceEditEngine.php @@ -127,6 +127,9 @@ final class AlmanacInterfaceEditEngine } protected function getObjectCreateCancelURI($object) { + if ($this->getDevice()) { + return $this->getDevice()->getURI(); + } return '/almanac/interface/'; }