mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 13:00: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:
parent
49e53d5709
commit
a9f0bd9b8f
1 changed files with 20 additions and 16 deletions
|
@ -71,22 +71,26 @@ final class PhabricatorApplicationTransactionCommentEditor
|
|||
$xaction->save();
|
||||
$xaction->attachComment($comment);
|
||||
|
||||
$object = id(new PhabricatorObjectQuery())
|
||||
->withPHIDs(array($xaction->getObjectPHID()))
|
||||
->setViewer($this->getActor())
|
||||
->executeOne();
|
||||
if ($object &&
|
||||
$object instanceof PhabricatorApplicationTransactionInterface) {
|
||||
$editor = $object->getApplicationTransactionEditor();
|
||||
$editor->setActor($this->getActor());
|
||||
$support_xactions = $editor->getExpandedSupportTransactions(
|
||||
$object,
|
||||
$xaction);
|
||||
if ($support_xactions) {
|
||||
$editor
|
||||
->setContentSource($this->getContentSource())
|
||||
->setContinueOnNoEffect(true)
|
||||
->applyTransactions($object, $support_xactions);
|
||||
// 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())
|
||||
->withPHIDs(array($xaction->getObjectPHID()))
|
||||
->setViewer($this->getActor())
|
||||
->executeOne();
|
||||
if ($object &&
|
||||
$object instanceof PhabricatorApplicationTransactionInterface) {
|
||||
$editor = $object->getApplicationTransactionEditor();
|
||||
$editor->setActor($this->getActor());
|
||||
$support_xactions = $editor->getExpandedSupportTransactions(
|
||||
$object,
|
||||
$xaction);
|
||||
if ($support_xactions) {
|
||||
$editor
|
||||
->setContentSource($this->getContentSource())
|
||||
->setContinueOnNoEffect(true)
|
||||
->applyTransactions($object, $support_xactions);
|
||||
}
|
||||
}
|
||||
}
|
||||
$xaction->endReadLocking();
|
||||
|
|
Loading…
Reference in a new issue