Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2644730
D25705.1732335996.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
1 KB
Referenced Files
None
Subscribers
None
D25705.1732335996.diff
View Options
diff --git a/src/applications/phriction/controller/PhrictionEditController.php b/src/applications/phriction/controller/PhrictionEditController.php
--- a/src/applications/phriction/controller/PhrictionEditController.php
+++ b/src/applications/phriction/controller/PhrictionEditController.php
@@ -117,6 +117,19 @@
$v_cc = $request->getArr('cc');
$v_projects = $request->getArr('projects');
$v_space = $request->getStr('spacePHID');
+ $file_phids_to_attach = [];
+
+ $content_metadata = $request->getStr('content_metadata');
+ if ($content_metadata) {
+ $content_metadata = phutil_json_decode($content_metadata);
+ if (
+ isset($content_metadata['attachedFilePHIDs']) &&
+ is_array($content_metadata['attachedFilePHIDs'])
+ ) {
+ $file_phids_to_attach = $content_metadata['attachedFilePHIDs'];
+ }
+ }
+
if ($save_as_draft) {
$edit_type = PhrictionDocumentDraftTransaction::TRANSACTIONTYPE;
@@ -134,9 +147,27 @@
$xactions[] = id(new PhrictionTransaction())
->setTransactionType(PhrictionDocumentTitleTransaction::TRANSACTIONTYPE)
->setNewValue($title);
- $xactions[] = id(new PhrictionTransaction())
+ $content_xaction = id(new PhrictionTransaction())
->setTransactionType($edit_type)
->setNewValue($content_text);
+
+ if ($file_phids_to_attach) {
+ $attached_file_phids = [];
+ foreach ($file_phids_to_attach as $phid) {
+ $attached_file_phids[$phid] = $phid;
+ }
+
+ $metadata_object = array(
+ 'remarkup.control' => array(
+ 'attachedFilePHIDs' => $attached_file_phids,
+ ),
+ );
+
+ $content_xaction->setMetadata($metadata_object);
+ }
+
+ $xactions[] = $content_xaction;
+
$xactions[] = id(new PhrictionTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)
->setNewValue($v_view)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 04:26 (10 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
989556
Default Alt Text
D25705.1732335996.diff (1 KB)
Attached To
Mode
D25705: Fix missing file attachment in Phriction
Attached
Detach File
Event Timeline
Log In to Comment