Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Real processing of fired condition

  • Loading branch information...
commit 48a7269acb29e549a8e8468eef72d911e99e45f9 1 parent 2848a49
@nijel nijel authored
Showing with 14 additions and 1 deletion.
  1. +14 −1 libraries/Advisor.class.php
View
15 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';
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.