mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 05:50:55 +01:00
Allow Phame posts to be loaded by handle
Summary: Primarily, this makes flagging work on them. Test Plan: Flagged / Unflagged a post. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T1373 Differential Revision: https://secure.phabricator.com/D3702
This commit is contained in:
parent
4de5e949ca
commit
0c4eb79d3a
1 changed files with 23 additions and 0 deletions
|
@ -539,6 +539,29 @@ final class PhabricatorObjectHandleData {
|
|||
$handles[$phid] = $handle;
|
||||
}
|
||||
break;
|
||||
case PhabricatorPHIDConstants::PHID_TYPE_POST:
|
||||
$posts = id(new PhamePostQuery())
|
||||
->withPHIDs($phids)
|
||||
->setViewer($this->viewer)
|
||||
->execute();
|
||||
$posts = mpull($posts, null, 'getPHID');
|
||||
|
||||
foreach ($phids as $phid) {
|
||||
$handle = new PhabricatorObjectHandle();
|
||||
$handle->setPHID($phid);
|
||||
$handle->setType($type);
|
||||
if (empty($posts[$phid])) {
|
||||
$handle->setName('Unknown Post');
|
||||
} else {
|
||||
$post = $posts[$phid];
|
||||
$handle->setName($post->getTitle());
|
||||
$handle->setFullName($post->getTitle());
|
||||
$handle->setURI('/phame/post/view/'.$post->getID().'/');
|
||||
$handle->setComplete(true);
|
||||
}
|
||||
$handles[$phid] = $handle;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$loader = null;
|
||||
if (isset($external_loaders[$type])) {
|
||||
|
|
Loading…
Reference in a new issue