Page MenuHomePhabricator

D21829.id.diff
No OneTemporary

D21829.id.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
Sun, Oct 20, 2:34 PM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6731518
Default Alt Text
D21829.id.diff (1 KB)

Event Timeline