Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15410831
D8188.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D8188.diff
View Options
Index: src/applications/search/controller/PhabricatorSearchSelectController.php
===================================================================
--- src/applications/search/controller/PhabricatorSearchSelectController.php
+++ src/applications/search/controller/PhabricatorSearchSelectController.php
@@ -23,31 +23,36 @@
$query->setParameter('query', $query_str);
$query->setParameter('types', array($this->type));
+ $status_open = PhabricatorSearchRelationship::RELATIONSHIP_OPEN;
+
switch ($request->getStr('filter')) {
case 'assigned':
- $query->setParameter('owner', array($user->getPHID()));
- $query->setParameter('open', 1);
+ $query->setParameter('ownerPHIDs', array($user->getPHID()));
+ $query->setParameter('statuses', array($status_open));
break;
case 'created';
- $query->setParameter('author', array($user->getPHID()));
+ $query->setParameter('authorPHIDs', array($user->getPHID()));
// TODO - if / when we allow pholio mocks to be archived, etc
// update this
if ($this->type != PholioPHIDTypeMock::TYPECONST) {
- $query->setParameter('open', 1);
+ $query->setParameter('statuses', array($status_open));
}
break;
case 'open':
- $query->setParameter('open', 1);
+ $query->setParameter('statuses', array($status_open));
break;
}
- $query->setParameter('exclude', $request->getStr('exclude'));
- $query->setParameter('limit', 100);
+ $query->setParameter('excludePHIDs', array($request->getStr('exclude')));
- $engine = PhabricatorSearchEngineSelector::newSelector()->newEngine();
- $results = $engine->executeSearch($query);
+ $results = id(new PhabricatorSearchDocumentQuery())
+ ->setViewer($user)
+ ->withSavedQuery($query)
+ ->setOffset(0)
+ ->setLimit(100)
+ ->execute();
- $phids = array_fill_keys($results, true);
+ $phids = array_fill_keys(mpull($results, 'getPHID'), true);
$phids += $this->queryObjectNames($query_str);
$phids = array_keys($phids);
Index: src/applications/search/query/PhabricatorSearchDocumentQuery.php
===================================================================
--- src/applications/search/query/PhabricatorSearchDocumentQuery.php
+++ src/applications/search/query/PhabricatorSearchDocumentQuery.php
@@ -25,6 +25,19 @@
}
protected function willFilterPage(array $handles) {
+
+ // NOTE: This is used by the object selector dialog to exclude the object
+ // you're looking at, so that, e.g., a task can't be set as a dependency
+ // of itself in the UI.
+
+ // TODO: Remove this after object selection moves to ApplicationSearch.
+
+ $exclude = array();
+ if ($this->savedQuery) {
+ $exclude_phids = $this->savedQuery->getParameter('excludePHIDs', array());
+ $exclude = array_fuse($exclude_phids);
+ }
+
foreach ($handles as $key => $handle) {
if (!$handle->isComplete()) {
unset($handles[$key]);
@@ -34,6 +47,10 @@
unset($handles[$key]);
continue;
}
+ if (isset($exclude[$handle->getPHID()])) {
+ unset($handles[$key]);
+ continue;
+ }
}
return $handles;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 20, 8:31 AM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7712726
Default Alt Text
D8188.diff (3 KB)
Attached To
Mode
D8188: Fix alternate filtering conditions in object selector dialog
Attached
Detach File
Event Timeline
Log In to Comment