From d2e1c4163a3b4695d67d91b292c3e1ac7ec5e4d3 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 9 Sep 2019 13:33:53 -0700 Subject: [PATCH] When a project has a custom icon, use that icon to label the project policy in the policy dropown Summary: Fixes T8808. Currently, all project use the default ("Briefcase") project icon when they appear in a policy dropdown. Since project policies are separated out into a "Members of Projects" section of the dropdown anyway, there is no reason not to use the actual project icon, which is often more clear. Test Plan: {F6849927} Maniphest Tasks: T8808 Differential Revision: https://secure.phabricator.com/D20799 --- src/applications/policy/storage/PhabricatorPolicy.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/applications/policy/storage/PhabricatorPolicy.php b/src/applications/policy/storage/PhabricatorPolicy.php index 2df8fdf6a0..3d6b4ca609 100644 --- a/src/applications/policy/storage/PhabricatorPolicy.php +++ b/src/applications/policy/storage/PhabricatorPolicy.php @@ -85,8 +85,10 @@ final class PhabricatorPolicy $phid_type = phid_get_type($policy_identifier); switch ($phid_type) { case PhabricatorProjectProjectPHIDType::TYPECONST: - $policy->setType(PhabricatorPolicyType::TYPE_PROJECT); - $policy->setName($handle->getName()); + $policy + ->setType(PhabricatorPolicyType::TYPE_PROJECT) + ->setName($handle->getName()) + ->setIcon($handle->getIcon()); break; case PhabricatorPeopleUserPHIDType::TYPECONST: $policy->setType(PhabricatorPolicyType::TYPE_USER);