Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14838751
D16900.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
D16900.diff
View Options
diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
--- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
@@ -510,15 +510,23 @@
}
$viewer = $this->getViewer();
+ $in_handles = $viewer->loadHandles($in_phids);
+ $out_handles = $viewer->loadHandles($out_phids);
+
+ $in_handles = $this->getCompleteHandles($in_handles);
+ $out_handles = $this->getCompleteHandles($out_handles);
+
+ if (!count($in_handles) && !count($out_handles)) {
+ return null;
+ }
+
$view = new PHUIPropertyListView();
- if ($in_phids) {
- $in_handles = $viewer->loadHandles($in_phids);
+ if (count($in_handles)) {
$view->addProperty(pht('Mentioned In'), $in_handles->renderList());
}
- if ($out_phids) {
- $out_handles = $viewer->loadHandles($out_phids);
+ if (count($out_handles)) {
$view->addProperty(pht('Mentioned Here'), $out_handles->renderList());
}
@@ -528,4 +536,18 @@
->appendChild($view);
}
+ private function getCompleteHandles(PhabricatorHandleList $handles) {
+ $phids = array();
+
+ foreach ($handles as $phid => $handle) {
+ if (!$handle->isComplete()) {
+ continue;
+ }
+ $phids[] = $phid;
+ }
+
+ return $handles->newSublist($phids);
+ }
+
+
}
diff --git a/src/applications/phid/handle/pool/PhabricatorHandleList.php b/src/applications/phid/handle/pool/PhabricatorHandleList.php
--- a/src/applications/phid/handle/pool/PhabricatorHandleList.php
+++ b/src/applications/phid/handle/pool/PhabricatorHandleList.php
@@ -74,6 +74,24 @@
}
+ /**
+ * Create a new list with a subset of the PHIDs in this list.
+ */
+ public function newSublist(array $phids) {
+ foreach ($phids as $phid) {
+ if (!isset($this[$phid])) {
+ throw new Exception(
+ pht(
+ 'Trying to create a new sublist of an existsing handle list, '.
+ 'but PHID "%s" does not appear in the parent list.',
+ $phid));
+ }
+ }
+
+ return $this->handlePool->newHandleList($phids);
+ }
+
+
/* -( Rendering )---------------------------------------------------------- */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 1, 5:56 PM (19 h, 44 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7082448
Default Alt Text
D16900.diff (2 KB)
Attached To
Mode
D16900: Strip restricted and incomplete handles from the "Mentions" tab on Maniphest tasks
Attached
Detach File
Event Timeline
Log In to Comment