@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhabricatorProjectTriggerUnknownRule
4 extends PhabricatorProjectTriggerRule {
5
6 const TRIGGERTYPE = 'unknown';
7
8 public function getSelectControlName() {
9 return pht('(Unknown Rule)');
10 }
11
12 protected function isSelectableRule() {
13 return false;
14 }
15
16 protected function assertValidRuleRecordFormat($value) {
17 return;
18 }
19
20 protected function newDropTransactions($object, $value) {
21 return array();
22 }
23
24 protected function newDropEffects($value) {
25 return array();
26 }
27
28 protected function isValidRule() {
29 return false;
30 }
31
32 protected function newInvalidView() {
33 return array(
34 id(new PHUIIconView())
35 ->setIcon('fa-exclamation-triangle yellow'),
36 ' ',
37 pht(
38 'This is a trigger rule with a unknown type ("%s").',
39 $this->getRecord()->getType()),
40 );
41 }
42
43 protected function getDefaultValue() {
44 return null;
45 }
46
47 protected function getPHUIXControlType() {
48 return null;
49 }
50
51 protected function getPHUIXControlSpecification() {
52 return null;
53 }
54
55 public function getRuleViewLabel() {
56 return pht('Unknown Rule');
57 }
58
59 public function getRuleViewDescription($value) {
60 return pht(
61 'This is an unknown rule of type "%s". An administrator may have '.
62 'edited or removed an extension which implements this rule type.',
63 $this->getRecord()->getType());
64 }
65
66 public function getRuleViewIcon($value) {
67 return id(new PHUIIconView())
68 ->setIcon('fa-question-circle', 'yellow');
69 }
70
71}