Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15430957
D15971.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D15971.diff
View Options
diff --git a/src/applications/owners/storage/PhabricatorOwnersOwner.php b/src/applications/owners/storage/PhabricatorOwnersOwner.php
--- a/src/applications/owners/storage/PhabricatorOwnersOwner.php
+++ b/src/applications/owners/storage/PhabricatorOwnersOwner.php
@@ -45,25 +45,37 @@
'packageID IN (%Ls)',
$package_ids);
- $all_phids = phid_group_by_type(mpull($owners, 'getUserPHID'));
+ $type_user = PhabricatorPeopleUserPHIDType::TYPECONST;
+ $type_project = PhabricatorProjectProjectPHIDType::TYPECONST;
- $user_phids = idx($all_phids,
- PhabricatorPeopleUserPHIDType::TYPECONST,
- array());
+ $user_phids = array();
+ $project_phids = array();
+ foreach ($owners as $owner) {
+ $owner_phid = $owner->getUserPHID();
+ switch (phid_get_type($owner_phid)) {
+ case PhabricatorPeopleUserPHIDType::TYPECONST:
+ $user_phids[] = $owner_phid;
+ break;
+ case PhabricatorProjectProjectPHIDType::TYPECONST:
+ $project_phids[] = $owner_phid;
+ break;
+ }
+ }
- if ($user_phids) {
+ if ($project_phids) {
$projects = id(new PhabricatorProjectQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
- ->withMemberPHIDs($user_phids)
- ->withIsMilestone(false)
+ ->withPHIDs($project_phids)
+ ->needMembers(true)
->execute();
- $project_phids = mpull($projects, 'getPHID');
- } else {
- $project_phids = array();
+ foreach ($projects as $project) {
+ foreach ($project->getMemberPHIDs() as $member_phid) {
+ $user_phids[] = $member_phid;
+ }
+ }
}
- $all_phids = array_fuse($user_phids) + array_fuse($project_phids);
-
- return array_values($all_phids);
+ $user_phids = array_fuse($user_phids);
+ return array_values($user_phids);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 25, 9:51 AM (2 d, 22 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7640107
Default Alt Text
D15971.diff (1 KB)
Attached To
Mode
D15971: Fix expansion of projects into lists of user PHIDs
Attached
Detach File
Event Timeline
Log In to Comment