1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 05:20:56 +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,6 +71,9 @@ final class PhabricatorApplicationTransactionCommentEditor
$xaction->save(); $xaction->save();
$xaction->attachComment($comment); $xaction->attachComment($comment);
// For comment edits, we need to make sure there are no automagical
// transactions like adding mentions or projects.
if ($new_version > 1) {
$object = id(new PhabricatorObjectQuery()) $object = id(new PhabricatorObjectQuery())
->withPHIDs(array($xaction->getObjectPHID())) ->withPHIDs(array($xaction->getObjectPHID()))
->setViewer($this->getActor()) ->setViewer($this->getActor())
@ -89,6 +92,7 @@ final class PhabricatorApplicationTransactionCommentEditor
->applyTransactions($object, $support_xactions); ->applyTransactions($object, $support_xactions);
} }
} }
}
$xaction->endReadLocking(); $xaction->endReadLocking();
$xaction->saveTransaction(); $xaction->saveTransaction();