mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42:41 +01:00
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
This commit is contained in:
parent
ee6e2a396f
commit
6fea5e5ce7
2 changed files with 0 additions and 26 deletions
|
@ -78,12 +78,6 @@ final class PhabricatorApplicationTransactionCommentEditor
|
||||||
$comment->setViewPolicy(PhabricatorPolicies::POLICY_PUBLIC);
|
$comment->setViewPolicy(PhabricatorPolicies::POLICY_PUBLIC);
|
||||||
$comment->setEditPolicy($this->getActingAsPHID());
|
$comment->setEditPolicy($this->getActingAsPHID());
|
||||||
|
|
||||||
$file_phids = PhabricatorMarkupEngine::extractFilePHIDsFromEmbeddedFiles(
|
|
||||||
$actor,
|
|
||||||
array(
|
|
||||||
$comment->getContent(),
|
|
||||||
));
|
|
||||||
|
|
||||||
$xaction->openTransaction();
|
$xaction->openTransaction();
|
||||||
$xaction->beginReadLocking();
|
$xaction->beginReadLocking();
|
||||||
if ($xaction->getID()) {
|
if ($xaction->getID()) {
|
||||||
|
@ -132,18 +126,6 @@ final class PhabricatorApplicationTransactionCommentEditor
|
||||||
$xaction->endReadLocking();
|
$xaction->endReadLocking();
|
||||||
$xaction->saveTransaction();
|
$xaction->saveTransaction();
|
||||||
|
|
||||||
// Add links to any files newly referenced by the edit.
|
|
||||||
if ($file_phids) {
|
|
||||||
$editor = new PhabricatorEdgeEditor();
|
|
||||||
foreach ($file_phids as $file_phid) {
|
|
||||||
$editor->addEdge(
|
|
||||||
$xaction->getObjectPHID(),
|
|
||||||
PhabricatorObjectHasFileEdgeType::EDGECONST ,
|
|
||||||
$file_phid);
|
|
||||||
}
|
|
||||||
$editor->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4042,15 +4042,7 @@ abstract class PhabricatorApplicationTransactionEditor
|
||||||
PhabricatorLiskDAO $object,
|
PhabricatorLiskDAO $object,
|
||||||
array $xactions) {
|
array $xactions) {
|
||||||
|
|
||||||
$changes = $this->getRemarkupChanges($xactions);
|
|
||||||
$blocks = mpull($changes, 'getNewValue');
|
|
||||||
|
|
||||||
$phids = array();
|
$phids = array();
|
||||||
if ($blocks) {
|
|
||||||
$phids[] = PhabricatorMarkupEngine::extractFilePHIDsFromEmbeddedFiles(
|
|
||||||
$this->getActor(),
|
|
||||||
$blocks);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($xactions as $xaction) {
|
foreach ($xactions as $xaction) {
|
||||||
$type = $xaction->getTransactionType();
|
$type = $xaction->getTransactionType();
|
||||||
|
|
Loading…
Reference in a new issue