diff --git a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php b/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php index aea6f10530..d4cbfcab2f 100644 --- a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php +++ b/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php @@ -19,6 +19,13 @@ final class HeraldManiphestTaskAdapter extends HeraldAdapter { 'React to tasks being created or updated.'); } + public function getRepetitionOptions() { + return array( + HeraldRepetitionPolicyConfig::EVERY, + HeraldRepetitionPolicyConfig::FIRST, + ); + } + public function supportsRuleType($rule_type) { switch ($rule_type) { case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL: diff --git a/src/applications/herald/engine/HeraldEngine.php b/src/applications/herald/engine/HeraldEngine.php index acc9556c97..5e62a8e19d 100644 --- a/src/applications/herald/engine/HeraldEngine.php +++ b/src/applications/herald/engine/HeraldEngine.php @@ -61,10 +61,14 @@ final class HeraldEngine { $effects = array(); foreach ($rules as $phid => $rule) { $this->stack = array(); + + $policy_first = HeraldRepetitionPolicyConfig::FIRST; + $policy_first_int = HeraldRepetitionPolicyConfig::toInt($policy_first); + $is_first_only = ($rule->getRepetitionPolicy() == $policy_first_int); + try { if (!$this->getDryRun() && - ($rule->getRepetitionPolicy() == - HeraldRepetitionPolicyConfig::FIRST) && + $is_first_only && $rule->getRuleApplied($object->getPHID())) { // This is not a dry run, and this rule is only supposed to be // applied a single time, and it's already been applied... diff --git a/src/applications/herald/storage/HeraldRule.php b/src/applications/herald/storage/HeraldRule.php index 81aa6125ba..7610935460 100644 --- a/src/applications/herald/storage/HeraldRule.php +++ b/src/applications/herald/storage/HeraldRule.php @@ -17,7 +17,7 @@ final class HeraldRule extends HeraldDAO protected $isDisabled = 0; protected $triggerObjectPHID; - protected $configVersion = 30; + protected $configVersion = 31; // phids for which this rule has been applied private $ruleApplied = self::ATTACHABLE;