Page MenuHomePhabricator

D21829.diff
No OneTemporary

D21829.diff

diff --git a/src/applications/transactions/editengine/PhabricatorEditEngine.php b/src/applications/transactions/editengine/PhabricatorEditEngine.php
--- a/src/applications/transactions/editengine/PhabricatorEditEngine.php
+++ b/src/applications/transactions/editengine/PhabricatorEditEngine.php
@@ -2017,6 +2017,17 @@
->setContent($comment_text));
}
+ if (strlen($comment_text)) {
+ if ($comment_metadata) {
+ $remarkup_xactions = self::newTransactionsFromRemarkupMetadata(
+ $template,
+ $comment_metadata);
+ foreach ($remarkup_xactions as $remarkup_xaction) {
+ $xactions[] = $remarkup_xaction;
+ }
+ }
+ }
+
$editor = $object->getApplicationTransactionEditor()
->setActor($viewer)
->setContinueOnNoEffect($request->isContinueRequest())
@@ -2079,6 +2090,26 @@
}
}
+ public static function newTransactionsFromRemarkupMetadata(
+ PhabricatorApplicationTransaction $template,
+ array $metadata) {
+
+ $xactions = array();
+
+ $attached_phids = idx($metadata, 'attachedFilePHIDs');
+ if (is_array($attached_phids) && $attached_phids) {
+ $attachment_map = array_fill_keys(
+ $attached_phids,
+ PhabricatorFileAttachment::MODE_ATTACH);
+
+ $xactions[] = id(clone $template)
+ ->setTransactionType(PhabricatorTransactions::TYPE_FILE)
+ ->setNewValue($attachment_map);
+ }
+
+ return $xactions;
+ }
+
protected function newDraftEngine($object) {
$viewer = $this->getViewer();

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 27, 10:16 PM (8 h, 41 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6933427
Default Alt Text
D21829.diff (1 KB)

Event Timeline