1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02: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:
epriestley 2017-05-03 10:39:37 -07:00
parent d467a9e337
commit 60a19e3646
2 changed files with 12 additions and 1 deletions

View file

@ -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;

View file

@ -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;
} }