@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.

Do not extract file PHIDs from remarkup blocks for attachment

Summary: Ref T13603. When processing transactions that include remarkup blocks, stop extracting file references from them for attachment.

Test Plan: Submitted a remarkup block with a file reference, no longer saw automatic file attachment.

Maniphest Tasks: T13603

Differential Revision: https://secure.phabricator.com/D21812

-26
-18
src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php
··· 78 78 $comment->setViewPolicy(PhabricatorPolicies::POLICY_PUBLIC); 79 79 $comment->setEditPolicy($this->getActingAsPHID()); 80 80 81 - $file_phids = PhabricatorMarkupEngine::extractFilePHIDsFromEmbeddedFiles( 82 - $actor, 83 - array( 84 - $comment->getContent(), 85 - )); 86 - 87 81 $xaction->openTransaction(); 88 82 $xaction->beginReadLocking(); 89 83 if ($xaction->getID()) { ··· 131 125 } 132 126 $xaction->endReadLocking(); 133 127 $xaction->saveTransaction(); 134 - 135 - // Add links to any files newly referenced by the edit. 136 - if ($file_phids) { 137 - $editor = new PhabricatorEdgeEditor(); 138 - foreach ($file_phids as $file_phid) { 139 - $editor->addEdge( 140 - $xaction->getObjectPHID(), 141 - PhabricatorObjectHasFileEdgeType::EDGECONST , 142 - $file_phid); 143 - } 144 - $editor->save(); 145 - } 146 128 147 129 return $this; 148 130 }
-8
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 4042 4042 PhabricatorLiskDAO $object, 4043 4043 array $xactions) { 4044 4044 4045 - $changes = $this->getRemarkupChanges($xactions); 4046 - $blocks = mpull($changes, 'getNewValue'); 4047 - 4048 4045 $phids = array(); 4049 - if ($blocks) { 4050 - $phids[] = PhabricatorMarkupEngine::extractFilePHIDsFromEmbeddedFiles( 4051 - $this->getActor(), 4052 - $blocks); 4053 - } 4054 4046 4055 4047 foreach ($xactions as $xaction) { 4056 4048 $type = $xaction->getTransactionType();