From 4b39cc321b8892fa09b8e09d1eafbeb06ff47c04 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 30 Sep 2013 09:38:04 -0700 Subject: [PATCH] Fix application order, curing "Log Out" of wanderlust Summary: Fixes T3894. The "Log Out" icon has moved away from its rightmost position in the menubar. In rP2e5ac12, I added a "Policy" application. This was the root cause. The reordering logic (below) is slightly wrong. The `array_select_keys()` call is actually using the //strings// (like "Admnistration") to select the groups, not the correct constants (like "admin"). Use the constants instead and get the expected group ordering. Test Plan: Loaded page, "Log Out" is in the rightmost position. Reviewers: btrahan, chad Reviewed By: chad CC: aran Maniphest Tasks: T3894 Differential Revision: https://secure.phabricator.com/D7177 --- src/applications/base/PhabricatorApplication.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/applications/base/PhabricatorApplication.php b/src/applications/base/PhabricatorApplication.php index ecffc18295..a26e1f40a6 100644 --- a/src/applications/base/PhabricatorApplication.php +++ b/src/applications/base/PhabricatorApplication.php @@ -270,7 +270,10 @@ abstract class PhabricatorApplication { // ensures their event handlers register in application order. $apps = msort($apps, 'getApplicationOrder'); $apps = mgroup($apps, 'getApplicationGroup'); - $apps = array_select_keys($apps, self::getApplicationGroups()) + $apps; + + $group_order = array_keys(self::getApplicationGroups()); + $apps = array_select_keys($apps, $group_order) + $apps; + $apps = array_mergev($apps); $applications = $apps;