1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

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
This commit is contained in:
epriestley 2012-12-21 05:42:38 -08:00
parent 9358b08b46
commit 141318fd01

View file

@ -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) {