Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13986517
D8273.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
D8273.diff
View Options
Index: src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php
===================================================================
--- src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php
+++ src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php
@@ -120,6 +120,27 @@
return $xactions;
}
+ protected function willFilterPage(array $xactions) {
+ $object_phids = array_keys(mpull($xactions, null, 'getObjectPHID'));
+
+ $objects = id(new PhabricatorObjectQuery())
+ ->setViewer($this->getViewer())
+ ->setParentQuery($this)
+ ->withPHIDs($object_phids)
+ ->execute();
+
+ foreach ($xactions as $key => $xaction) {
+ $object_phid = $xaction->getObjectPHID();
+ if (empty($objects[$object_phid])) {
+ unset($xactions[$key]);
+ continue;
+ }
+ $xaction->attachObject($objects[$object_phid]);
+ }
+
+ return $xactions;
+ }
+
private function buildWhereClause(AphrontDatabaseConnection $conn_r) {
$where = array();
Index: src/applications/transactions/storage/PhabricatorApplicationTransaction.php
===================================================================
--- src/applications/transactions/storage/PhabricatorApplicationTransaction.php
+++ src/applications/transactions/storage/PhabricatorApplicationTransaction.php
@@ -29,6 +29,7 @@
private $renderingTarget = self::TARGET_HTML;
private $transactionGroup = array();
private $viewer = self::ATTACHABLE;
+ private $object = self::ATTACHABLE;
abstract public function getApplicationTransactionType();
@@ -110,6 +111,15 @@
return $this;
}
+ public function attachObject($object) {
+ $this->object = $object;
+ return $this;
+ }
+
+ public function getObject() {
+ return $this->assertAttached($this->object);
+ }
+
/* -( Rendering )---------------------------------------------------------- */
public function setRenderingTarget($rendering_target) {
@@ -388,10 +398,7 @@
case PhabricatorTransactions::TYPE_CUSTOMFIELD:
$key = $this->getMetadataValue('customfield:key');
$field = PhabricatorCustomField::getObjectField(
- // TODO: This is a giant hack, but we currently don't have a way to
- // get the contextual object and this pathway is only hit by
- // Maniphest. We should provide a way to get the actual object here.
- new ManiphestTask(),
+ $this->getObject(),
PhabricatorCustomField::ROLE_APPLICATIONTRANSACTIONS,
$key);
if ($field) {
@@ -455,10 +462,7 @@
case PhabricatorTransactions::TYPE_CUSTOMFIELD:
$key = $this->getMetadataValue('customfield:key');
$field = PhabricatorCustomField::getObjectField(
- // TODO: This is a giant hack, but we currently don't have a way to
- // get the contextual object and this pathway is only hit by
- // Maniphest. We should provide a way to get the actual object here.
- new ManiphestTask(),
+ $this->getObject(),
PhabricatorCustomField::ROLE_APPLICATIONTRANSACTIONS,
$key);
if ($field) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 22, 3:36 AM (3 w, 21 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6737302
Default Alt Text
D8273.diff (3 KB)
Attached To
Mode
D8273: Load and attach objects when loading application transactions
Attached
Detach File
Event Timeline
Log In to Comment