From 838fc5c68aa2a31a7b9892860246cfa03f0a7805 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Mon, 27 Mar 2017 11:29:02 -0400 Subject: [PATCH] HOR-2791 --- workflow/engine/classes/class.pmDynaform.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/workflow/engine/classes/class.pmDynaform.php b/workflow/engine/classes/class.pmDynaform.php index 7df0110d1..f09bf837a 100644 --- a/workflow/engine/classes/class.pmDynaform.php +++ b/workflow/engine/classes/class.pmDynaform.php @@ -754,6 +754,10 @@ class pmDynaform preg_match_all('/\@(?:([\@\%\#\=\!Qq])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]*?)*)\))/', $json->sql, $result, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE); $variables = isset($result[2]) ? $result[2] : array(); foreach ($variables as $key => $value) { + //Prevents an infinite cycle. If the name of the variable is used within its own dependent. + if ($value[0] === $json->variable) { + continue; + } $jsonSearch = $this->jsonsf(G::json_decode($this->record["DYN_CONTENT"]), $value[0], $json->variable === "" ? "id" : "variable"); $a = $this->getValuesDependentFields($jsonSearch); foreach ($a as $i => $v) {