Page MenuHomePhorge

D25709.1732298775.diff
No OneTemporary

D25709.1732298775.diff

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);
+
+ $xaction_comment = PhabricatorTransactions::findOneByType(
+ $xactions,
+ PhabricatorTransactions::TYPE_COMMENT);
+
+ $text_metadata = $request->getStr('text_metadata');
+ if ($text_metadata) {
+ $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 PhabricatorTransactions|null
+ */
+ public static function findOneByType($xactions, $type) {
+ foreach ($xactions as $xaction) {
+ if ($xaction->getTransactionType() === $type) {
+ return $xaction;
+ }
+ }
+ return null;
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 18:06 (19 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
989282
Default Alt Text
D25709.1732298775.diff (2 KB)

Event Timeline