Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14449507
D21829.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D21829.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D21829: Generate attachment edges from drag-and-dropped files in stacked comments
Attached
Detach File
Event Timeline
Log In to Comment