Permalink
Browse files

Real processing of fired condition

  • Loading branch information...
nijel committed May 3, 2012
1 parent 2848a49 commit 48a7269acb29e549a8e8468eef72d911e99e45f9
Showing with 14 additions and 1 deletion.
  1. +14 −1 libraries/Advisor.class.php
@@ -216,6 +216,7 @@ function addRule($type, $rule)
} else {
$rule['justification'] = $this->translate($rule['justification']);
}
+ $rule['id'] = $rule['name'];
$rule['name'] = $this->translate($rule['name']);
$rule['issue'] = $this->translate($rule['issue']);
@@ -248,7 +249,19 @@ function addRule($type, $rule)
*/
private function ruleExprEvaluate_fired($matches)
{
- return '1'; //isset($this->runResult[\'fired\']
+ // No list of fired rules
+ if (!isset($this->runResult['fired'])) {
+ return '0';
+ }
+
+ // Did matching rule fire?
+ foreach ($this->runResult['fired'] as $rule) {
+ if ($rule['id'] == $matches[2]) {
+ return '1';
+ }
+ }
+
+ return '0';
}
/**

0 comments on commit 48a7269

Please sign in to comment.