1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 17:30:59 +01:00

Transactions - don't bother checking for fancy transactions on comment create

Summary: Only necessary for edits, only bother if the comment version is greater than 1. Ref T6690. This is another way to fix T6690 -- this check will never run since you can't edit a conpherence comment -- **but** the fix already applied should happen too to future proof Conpherence.

Test Plan: made a comment on a diff - success. edited the comment and mentions were generated.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6690

Differential Revision: https://secure.phabricator.com/D10928
This commit is contained in:
Bob Trahan 2014-12-04 12:04:49 -08:00
parent 49e53d5709
commit a9f0bd9b8f

View file

@ -71,22 +71,26 @@ final class PhabricatorApplicationTransactionCommentEditor
$xaction->save(); $xaction->save();
$xaction->attachComment($comment); $xaction->attachComment($comment);
$object = id(new PhabricatorObjectQuery()) // For comment edits, we need to make sure there are no automagical
->withPHIDs(array($xaction->getObjectPHID())) // transactions like adding mentions or projects.
->setViewer($this->getActor()) if ($new_version > 1) {
->executeOne(); $object = id(new PhabricatorObjectQuery())
if ($object && ->withPHIDs(array($xaction->getObjectPHID()))
$object instanceof PhabricatorApplicationTransactionInterface) { ->setViewer($this->getActor())
$editor = $object->getApplicationTransactionEditor(); ->executeOne();
$editor->setActor($this->getActor()); if ($object &&
$support_xactions = $editor->getExpandedSupportTransactions( $object instanceof PhabricatorApplicationTransactionInterface) {
$object, $editor = $object->getApplicationTransactionEditor();
$xaction); $editor->setActor($this->getActor());
if ($support_xactions) { $support_xactions = $editor->getExpandedSupportTransactions(
$editor $object,
->setContentSource($this->getContentSource()) $xaction);
->setContinueOnNoEffect(true) if ($support_xactions) {
->applyTransactions($object, $support_xactions); $editor
->setContentSource($this->getContentSource())
->setContinueOnNoEffect(true)
->applyTransactions($object, $support_xactions);
}
} }
} }
$xaction->endReadLocking(); $xaction->endReadLocking();