Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15328560
D15003.id36243.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D15003.id36243.diff
View Options
diff --git a/src/applications/project/typeahead/PhabricatorProjectLogicalViewerDatasource.php b/src/applications/project/typeahead/PhabricatorProjectLogicalViewerDatasource.php
--- a/src/applications/project/typeahead/PhabricatorProjectLogicalViewerDatasource.php
+++ b/src/applications/project/typeahead/PhabricatorProjectLogicalViewerDatasource.php
@@ -63,10 +63,16 @@
$phids = mpull($projects, 'getPHID');
$results = array();
- foreach ($phids as $phid) {
+ if ($phids) {
+ foreach ($phids as $phid) {
+ $results[] = new PhabricatorQueryConstraint(
+ PhabricatorQueryConstraint::OPERATOR_OR,
+ $phid);
+ }
+ } else {
$results[] = new PhabricatorQueryConstraint(
- PhabricatorQueryConstraint::OPERATOR_OR,
- $phid);
+ PhabricatorQueryConstraint::OPERATOR_EMPTY,
+ null);
}
return $results;
diff --git a/src/infrastructure/query/constraint/PhabricatorQueryConstraint.php b/src/infrastructure/query/constraint/PhabricatorQueryConstraint.php
--- a/src/infrastructure/query/constraint/PhabricatorQueryConstraint.php
+++ b/src/infrastructure/query/constraint/PhabricatorQueryConstraint.php
@@ -7,6 +7,7 @@
const OPERATOR_NOT = 'not';
const OPERATOR_NULL = 'null';
const OPERATOR_ANCESTOR = 'ancestor';
+ const OPERATOR_EMPTY = 'empty';
private $operator;
private $value;
diff --git a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
--- a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
+++ b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
@@ -1872,6 +1872,16 @@
return $this;
}
+ foreach ($this->edgeLogicConstraints as $type => $constraints) {
+ foreach ($constraints as $operator => $list) {
+ switch ($operator) {
+ case PhabricatorQueryConstraint::OPERATOR_EMPTY:
+ throw new PhabricatorEmptyQueryException(
+ pht('This query specifies an empty constraint.'));
+ }
+ }
+ }
+
// This should probably be more modular, eventually, but we only do
// project-based edge logic today.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 8, 5:48 AM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7374667
Default Alt Text
D15003.id36243.diff (2 KB)
Attached To
Mode
D15003: Don't return any results for viewerprojects() if the viewer is in no projects
Attached
Detach File
Event Timeline
Log In to Comment