From b4589224f2ac725b053c45f92a70943107ac80bc Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Mon, 22 Apr 2013 13:31:19 -0400 Subject: [PATCH] BUG 9933 Step conditions evaluating too early IMPROVEMENT --- workflow/engine/classes/class.pmScript.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/class.pmScript.php b/workflow/engine/classes/class.pmScript.php index f55e7786a..0fc97a9cb 100755 --- a/workflow/engine/classes/class.pmScript.php +++ b/workflow/engine/classes/class.pmScript.php @@ -335,9 +335,12 @@ class PMScript for ($i = 0; $i < $iOcurrences; $i ++) { // if the variables for that condition has not been previously defined then $variableIsDefined // is set to false - if (! isset( $this->aFields[$aMatch[2][$i][0]] )) { - // $variableIsDefined = false; + if (!isset($this->aFields[$aMatch[2][$i][0]]) && !isset($aMatch[5][$i][0])) { $this->aFields[$aMatch[2][$i][0]] = ''; + } else { + if (!isset($this->aFields[$aMatch[2][$i][0]])) { + eval("\$this->aFields['" . $aMatch[2][$i][0] . "']" . $aMatch[5][$i][0] . " = '';"); + } } $sAux = substr( $this->sScript, $iAux, $aMatch[0][$i][1] - $iAux ); if (! $bEqual) {