Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15392303
D14892.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
D14892.diff
View Options
diff --git a/src/applications/project/query/PhabricatorProjectQuery.php b/src/applications/project/query/PhabricatorProjectQuery.php
--- a/src/applications/project/query/PhabricatorProjectQuery.php
+++ b/src/applications/project/query/PhabricatorProjectQuery.php
@@ -226,11 +226,21 @@
// If we only need to know if the viewer is a member, we can restrict
// the query to just their PHID.
+ $any_edges = true;
if (!$this->needMembers && !$this->needWatchers) {
- $edge_query->withDestinationPHIDs(array($viewer_phid));
+ if ($viewer_phid) {
+ $edge_query->withDestinationPHIDs(array($viewer_phid));
+ } else {
+ // If we don't need members or watchers and don't have a viewer PHID
+ // (viewer is logged-out or omnipotent), they'll never be a member
+ // so we don't need to issue this query at all.
+ $any_edges = false;
+ }
}
- $edge_query->execute();
+ if ($any_edges) {
+ $edge_query->execute();
+ }
$membership_projects = array();
foreach ($projects as $project) {
@@ -242,9 +252,13 @@
$source_phids = array($project_phid);
}
- $member_phids = $edge_query->getDestinationPHIDs(
- $source_phids,
- array($member_type));
+ if ($any_edges) {
+ $member_phids = $edge_query->getDestinationPHIDs(
+ $source_phids,
+ array($member_type));
+ } else {
+ $member_phids = array();
+ }
if (in_array($viewer_phid, $member_phids)) {
$membership_projects[$project_phid] = $project;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 16, 2:25 PM (3 d, 19 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7513026
Default Alt Text
D14892.diff (1 KB)
Attached To
Mode
D14892: Clean up ProjectQuery when viewer is logged-out or omnipotent
Attached
Detach File
Event Timeline
Log In to Comment