Page MenuHomePhabricator

D10922.diff
No OneTemporary

D10922.diff

diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php
@@ -69,7 +69,26 @@
$xaction->setViewPolicy($comment->getViewPolicy());
$xaction->setEditPolicy($comment->getEditPolicy());
$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);
+ }
+ }
$xaction->endReadLocking();
$xaction->saveTransaction();
@@ -85,8 +104,6 @@
$editor->save();
}
- $xaction->attachComment($comment);
-
return $this;
}
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -1117,6 +1117,29 @@
}
+ public function getExpandedSupportTransactions(
+ PhabricatorLiskDAO $object,
+ PhabricatorApplicationTransaction $xaction) {
+
+ $xactions = array($xaction);
+ $xactions = $this->expandSupportTransactions(
+ $object,
+ $xactions);
+
+ if (count($xactions) == 1) {
+ return array();
+ }
+
+ foreach ($xactions as $index => $cxaction) {
+ if ($cxaction === $xaction) {
+ unset($xactions[$index]);
+ break;
+ }
+ }
+
+ return $xactions;
+ }
+
private function expandSupportTransactions(
PhabricatorLiskDAO $object,
array $xactions) {

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 10:51 AM (21 h, 11 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6910200
Default Alt Text
D10922.diff (2 KB)

Event Timeline