From 141318fd01f427c47b970b38a65fc13a353916b0 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 21 Dec 2012 05:42:38 -0800 Subject: [PATCH] Fix a Maniphest issue where multiple saved copies of a query break the menu Summary: Fixes T2210. Recently, we require unique keys on menu items, but it's currently possible in Maniphest to save the same custom query under multiple names. Avoid exploding in this case (we'll hide the duplicates). This isn't a great fix, but makes Maniphest usable again. Test Plan: Saved the same query twice, laoded page, got exception, applied patch, loaded page, saw duplicate query stripped. Reviewers: btrahan, vrana Reviewed By: btrahan CC: aran Maniphest Tasks: T2210 Differential Revision: https://secure.phabricator.com/D4247 --- .../maniphest/controller/ManiphestController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/applications/maniphest/controller/ManiphestController.php b/src/applications/maniphest/controller/ManiphestController.php index 7b597c6b04..aa607a6465 100644 --- a/src/applications/maniphest/controller/ManiphestController.php +++ b/src/applications/maniphest/controller/ManiphestController.php @@ -33,6 +33,12 @@ abstract class ManiphestController extends PhabricatorController { 'userPHID = %s ORDER BY isDefault DESC, name ASC', $user->getPHID()); + // TODO: Enforce uniqueness. Currently, it's possible to save the same + // query under multiple names, and then SideNavFilterView explodes on + // duplicate keys. Generally, we should clean up the custom/saved query + // code as it's a bit of a mess. + $custom = mpull($custom, null, 'getQueryKey'); + if ($custom) { $nav->addLabel('Saved Queries'); foreach ($custom as $query) {