mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Allow ApplicationTransactionEditor to figure out whether TYPE_COMMENT is supported or not
Summary: See D17812, etc. We can figure this out by looking at the object carefully. We don't need to go delete all the old TYPE_COMMENT (it doesn't hurt anything) but can nuke it when we see it. Test Plan: - Made a comment in Slowvote (supports commenting). - Viewed an Almanac device (does not support commenting). Reviewers: chad Reviewed By: chad Differential Revision: https://secure.phabricator.com/D17822
This commit is contained in:
parent
d467a9e337
commit
60a19e3646
2 changed files with 12 additions and 1 deletions
|
@ -14,7 +14,6 @@ final class PhabricatorSlowvoteEditor
|
||||||
public function getTransactionTypes() {
|
public function getTransactionTypes() {
|
||||||
$types = parent::getTransactionTypes();
|
$types = parent::getTransactionTypes();
|
||||||
|
|
||||||
$types[] = PhabricatorTransactions::TYPE_COMMENT;
|
|
||||||
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
|
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
|
||||||
|
|
||||||
$types[] = PhabricatorSlowvoteTransaction::TYPE_QUESTION;
|
$types[] = PhabricatorSlowvoteTransaction::TYPE_QUESTION;
|
||||||
|
|
|
@ -298,6 +298,18 @@ abstract class PhabricatorApplicationTransactionEditor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($template) {
|
||||||
|
try {
|
||||||
|
$comment = $template->getApplicationTransactionCommentObject();
|
||||||
|
} catch (PhutilMethodNotImplementedException $ex) {
|
||||||
|
$comment = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($comment) {
|
||||||
|
$types[] = PhabricatorTransactions::TYPE_COMMENT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $types;
|
return $types;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue