Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2680736
D25710.1734620304.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
D25710.1734620304.diff
View Options
diff --git a/src/applications/conpherence/controller/ConpherenceUpdateController.php b/src/applications/conpherence/controller/ConpherenceUpdateController.php
--- a/src/applications/conpherence/controller/ConpherenceUpdateController.php
+++ b/src/applications/conpherence/controller/ConpherenceUpdateController.php
@@ -79,6 +79,30 @@
$user,
$conpherence,
$message);
+
+ // The above may generate multiple transactions.
+ // In practice, the comment is the only one.
+ $xaction_comment = PhabricatorTransactions::findByType(
+ $xactions,
+ PhabricatorTransactions::TYPE_COMMENT);
+
+ $text_metadata = $request->getStr('text_metadata');
+ if ($text_metadata && $xaction_comment) {
+ $text_metadata = phutil_json_decode($text_metadata);
+ $attached_file_phids = idx($text_metadata,
+ 'attachedFilePHIDs',
+ array());
+ if ($attached_file_phids) {
+ $metadata_object = array(
+ 'remarkup.control' => array(
+ 'attachedFilePHIDs' => $attached_file_phids,
+ ),
+ );
+
+ $xaction_comment->setMetadata($metadata_object);
+ }
+ }
+
$delete_draft = true;
} else {
$action = ConpherenceUpdateActions::LOAD;
diff --git a/src/applications/transactions/constants/PhabricatorTransactions.php b/src/applications/transactions/constants/PhabricatorTransactions.php
--- a/src/applications/transactions/constants/PhabricatorTransactions.php
+++ b/src/applications/transactions/constants/PhabricatorTransactions.php
@@ -41,4 +41,19 @@
);
}
+ /**
+ * Find the first transaction that matches a type.
+ * @param array $xactions
+ * @param string $type
+ * @return PhabricatorTransaction|null
+ */
+ public static function findByType($xactions, $type) {
+ foreach ($xactions as $xaction) {
+ if ($xaction->getTransactionType() === $type) {
+ return $xaction;
+ }
+ }
+ return null;
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 14:58 (20 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1015110
Default Alt Text
D25710.1734620304.diff (2 KB)
Attached To
Mode
D25710: [STUB] Fix missing file attachment in Conpherence
Attached
Detach File
Event Timeline
Log In to Comment