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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user