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 @@ -398,7 +398,7 @@ $new = $xaction->getNewValue(); $type = $xaction->getTransactionType(); - $xtype = $this->getModularTransactionType($type); + $xtype = $this->getModularTransactionType($object, $type); if ($xtype) { $xtype = clone $xtype; $xtype->setStorage($xaction); @@ -493,7 +493,7 @@ $type = $xaction->getTransactionType(); - $xtype = $this->getModularTransactionType($type); + $xtype = $this->getModularTransactionType($object, $type); if ($xtype) { $xtype = clone $xtype; $xtype->setStorage($xaction); @@ -591,7 +591,7 @@ $type = $xaction->getTransactionType(); - $xtype = $this->getModularTransactionType($type); + $xtype = $this->getModularTransactionType($object, $type); if ($xtype) { $xtype = clone $xtype; $xtype->setStorage($xaction); @@ -712,7 +712,7 @@ } $type = $xaction->getTransactionType(); - $xtype = $this->getModularTransactionType($type); + $xtype = $this->getModularTransactionType($object, $type); if ($xtype) { return $xtype->getTransactionHasEffect( $object, @@ -745,7 +745,7 @@ $type = $xaction->getTransactionType(); - $xtype = $this->getModularTransactionType($type); + $xtype = $this->getModularTransactionType($object, $type); if ($xtype) { $xtype = clone $xtype; $xtype->setStorage($xaction); @@ -783,7 +783,7 @@ $type = $xaction->getTransactionType(); - $xtype = $this->getModularTransactionType($type); + $xtype = $this->getModularTransactionType($object, $type); if ($xtype) { $xtype = clone $xtype; $xtype->setStorage($xaction); @@ -1120,7 +1120,7 @@ continue; } - $xtype = $this->getModularTransactionType($type); + $xtype = $this->getModularTransactionType($object, $type); if (!$xtype) { continue; } @@ -1861,7 +1861,7 @@ foreach ($xactions as $xaction) { $type = $xaction->getTransactionType(); - $xtype = $this->getModularTransactionType($type); + $xtype = $this->getModularTransactionType($object, $type); if (!$xtype) { $capabilities = $this->getLegacyRequiredCapabilities($xaction); } else { @@ -2136,11 +2136,11 @@ PhabricatorApplicationTransaction $u, PhabricatorApplicationTransaction $v) { + $object = $this->object; $type = $u->getTransactionType(); - $xtype = $this->getModularTransactionType($type); + $xtype = $this->getModularTransactionType($object, $type); if ($xtype) { - $object = $this->object; return $xtype->mergeTransactions($object, $u, $v); } @@ -2866,7 +2866,7 @@ $errors = array(); - $xtype = $this->getModularTransactionType($type); + $xtype = $this->getModularTransactionType($object, $type); if ($xtype) { $errors[] = $xtype->validateTransactions($object, $xactions); } @@ -4009,8 +4009,9 @@ private function getMailDiffSectionHeader($xaction) { $type = $xaction->getTransactionType(); + $object = $this->object; - $xtype = $this->getModularTransactionType($type); + $xtype = $this->getModularTransactionType($object, $type); if ($xtype) { return $xtype->getMailDiffSectionHeader(); } @@ -4408,7 +4409,7 @@ foreach ($xactions as $xaction) { $type = $xaction->getTransactionType(); - $xtype = $this->getModularTransactionType($type); + $xtype = $this->getModularTransactionType($object, $type); if ($xtype) { $phids[] = $xtype->extractFilePHIDs($object, $xaction->getNewValue()); } else { @@ -4954,9 +4955,11 @@ $proxy_phids); } - private function getModularTransactionTypes() { + private function getModularTransactionTypes( + PhabricatorLiskDAO $object) { + if ($this->modularTypes === null) { - $template = $this->object->getApplicationTransactionTemplate(); + $template = $object->getApplicationTransactionTemplate(); if ($template instanceof PhabricatorModularTransaction) { $xtypes = $template->newModularTransactionTypes(); foreach ($xtypes as $key => $xtype) { @@ -4974,8 +4977,8 @@ return $this->modularTypes; } - private function getModularTransactionType($type) { - $types = $this->getModularTransactionTypes(); + private function getModularTransactionType($object, $type) { + $types = $this->getModularTransactionTypes($object); return idx($types, $type); } @@ -5535,7 +5538,7 @@ foreach ($xactions as $xaction) { $type = $xaction->getTransactionType(); - $xtype = $this->getModularTransactionType($type); + $xtype = $this->getModularTransactionType($object, $type); if ($xtype) { $xtype = clone $xtype; $xtype->setStorage($xaction); @@ -5582,8 +5585,9 @@ private function getTitleForTextMail( PhabricatorApplicationTransaction $xaction) { $type = $xaction->getTransactionType(); + $object = $this->object; - $xtype = $this->getModularTransactionType($type); + $xtype = $this->getModularTransactionType($object, $type); if ($xtype) { $xtype = clone $xtype; $xtype->setStorage($xaction); @@ -5599,8 +5603,9 @@ private function getTitleForHTMLMail( PhabricatorApplicationTransaction $xaction) { $type = $xaction->getTransactionType(); + $object = $this->object; - $xtype = $this->getModularTransactionType($type); + $xtype = $this->getModularTransactionType($object, $type); if ($xtype) { $xtype = clone $xtype; $xtype->setStorage($xaction); @@ -5617,8 +5622,9 @@ private function getBodyForTextMail( PhabricatorApplicationTransaction $xaction) { $type = $xaction->getTransactionType(); + $object = $this->object; - $xtype = $this->getModularTransactionType($type); + $xtype = $this->getModularTransactionType($object, $type); if ($xtype) { $xtype = clone $xtype; $xtype->setStorage($xaction);