@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix missing file attachment in Phriction

Summary:
When you drag and drop a file in the Phriction editor and then save the
corresponding wiki document, the file was only visible by the author.

Now the file is also attached to that document, making it visible.

Refs T15106

Test Plan:
1) open the Phriction editor to edit an existing or create a new wiki document
2) drag and drop file in it
3) save wiki document
4) verify file is attached to wiki document (other user can see file in wiki page)

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15106

Differential Revision: https://we.phorge.it/D25705

authored by

Valerio Bozzolan and committed by
Merula Turdus
118f9893 30257515

+23 -1
+23 -1
src/applications/phriction/controller/PhrictionEditController.php
··· 134 134 $xactions[] = id(new PhrictionTransaction()) 135 135 ->setTransactionType(PhrictionDocumentTitleTransaction::TRANSACTIONTYPE) 136 136 ->setNewValue($title); 137 - $xactions[] = id(new PhrictionTransaction()) 137 + $content_xaction = id(new PhrictionTransaction()) 138 138 ->setTransactionType($edit_type) 139 139 ->setNewValue($content_text); 140 + 141 + $content_metadata = $request->getStr('content_metadata'); 142 + if ($content_metadata) { 143 + $content_metadata = phutil_json_decode($content_metadata); 144 + $attached_file_phids = idx( 145 + $content_metadata, 146 + 'attachedFilePHIDs', 147 + array()); 148 + 149 + if ($attached_file_phids) { 150 + $metadata_object = array( 151 + 'remarkup.control' => array( 152 + 'attachedFilePHIDs' => $attached_file_phids, 153 + ), 154 + ); 155 + 156 + $content_xaction->setMetadata($metadata_object); 157 + } 158 + } 159 + 160 + $xactions[] = $content_xaction; 161 + 140 162 $xactions[] = id(new PhrictionTransaction()) 141 163 ->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY) 142 164 ->setNewValue($v_view)